I'm having a problem sending mail using the mail() function in PHP.
I used a simple script just to test it out:
<?php
// The message
$message = "Line 1\nLine 2\nLine 3";
// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);
// Send
$rc = mail('myname@myhost.com', 'Test Subject', $message);
if ($rc) {
print "Mail successfully sent!<br>";
}
else {
print "Failed to send mail<br>";
}
?>
I ran the script and it gave me the "Mail successfully sent!" message but nothing arrived.
My webhost uses CPanel. Is there anything I can configure there maybe?