php unable to sent email


Posted on 16th Feb 2014 07:03 pm by admin

Hi, guys, I try to send a email through php but unfortunately the mail unable to sent. Here is my code, any configuration that I need to change in order to send the email ? Anyone who know please help ? Thanks in advance.

<?// send e-mail to ...
$to="me@localhost";

// Your subject
$subject="Test";

// From
$header="from: your name <your email>";

// Your message
$message="Hello rn";
$message.="This is testrn";
$message.="Test again ";

// send email
$sentmail = mail($to,$subject,$message,$header);

// if your email succesfully sent
if($sentmail){
echo "Email Has Been Sent .";
}
else {
echo "Cannot Send Email ";
}
?>

The error message "Cannot Send Email" shown

No comments posted yet

Your Answer:

Login to answer
162 Like 14 Dislike
Previous forums Next forums
Other forums

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

How to file_get_contents when login required?
Hello!

I am trying to read data from a page that you have to be logged into to view, I am try

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

SAP Treasury - Commodities
We are running SAP ECC 6.0 with Treasury Activated.
EA-FIN is also activated (SFW5).

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

Edit MySQL Row Using PHP and HTML Form
Hello,

Here's what I'm trying to do. Build a page where a user enters a MySQL row number in.

Calling variables
I want to call this to my website but it doesn't display what I want it to,

Code: <h5&

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash