How do you send an E-Mail with PHP?

busy bee

New member
Here is my code. when i load the page, it says message sent thank you


<?php
$to="my email address";
$subject="test";
$message="this a test message";


mail($to,$subject,$message);

echo "message sent thank you";
?>
Yes SMTP is enabled and i tried your code and it said it was sent, but I did not receive a message.
 
<?php
$to="my email address";
$subject="test";
$message="this a test message";


$flag = mail($to,$subject,$message);
if($flag)
echo "message sent thank you";
else
echo "message not sent";
?>
And also check your SMTP configuration..
 
Back
Top