Hey guys,
Recently, my server has stopped sending e-mail with the PHP mail() function. Does anyone know how to trap what the error might be? As of right now, my code looks like this:
$user_email = "jon@jmarus.com";
$header = "From: Jon Marus <jon@jmarus.com>\r\n";
$header .= "Reply-To: Jon Marus <jon@jmarus.com>\r\n";
$subject = "Test E-mail";
$message = "This is a test e-mail.";
if (mail($user_email, $subject, $message, $header)) {
echo "<p>E-mail sent.</p>";
} else {
echo "<p>There was a problem with the server. Please try again later.</p>";
}
And it just returns: There was a problem with the server. Please try again later.
But I need a better error message to report to my webhost, who is getting extremely upset with me, because he says everything is fine.
Thanks!
Jon Marus