Sending email with PHP

Associate
Joined
6 Mar 2009
Posts
495
Ok guys i am trying to send an email with PHP but does seem to be working.

Here is the Code -
Code:
$to = "[email protected]";
$subject = "TEST";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";

Basically i have an if Statement and when it equals the statement i want it to send an email. I am getting the echo statement saying "Mail Sent", but email not sending.

Have read somewhere that you may have to edit the SMTP setting in the php.ini file.

Amy suggestions??

Cheers
 
Back
Top Bottom