Our web server was recently relocated and we are having DNS issues with some setting that apparently did not transfer well. We have a mail function that seems to successfully send to anyone but our own domain. Mail sent to anyone@gmail.com or anyone@yahoo.com works but mail sent to anyone@ourowndomain.com fails at the mail() function.
Unfortunately, I cannot get PHP to report why mail() is failing. I'm hoping that by finding a verbose error with the mail function, I can start to diagnose what has gone wrong with our DNS modifications.
Here are snippets from the function. I have turned on all reporting that I know to turn on. The mail function is set to give a success message when it works, or a warning when it fails. Can anyone offer ideas on how to get it to specify why it fails?
Unfortunately, I cannot get PHP to report why mail() is failing. I'm hoping that by finding a verbose error with the mail function, I can start to diagnose what has gone wrong with our DNS modifications.
Here are snippets from the function. I have turned on all reporting that I know to turn on. The mail function is set to give a success message when it works, or a warning when it fails. Can anyone offer ideas on how to get it to specify why it fails?
Code:
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
//...
if (@mail($to, $subject, $body, $headers, "-f $from")) {
$alertmessage .= "<font color=\"green\"><b>Mail has been sent to $to</b></font><br /><br />";
} else {
$alertmessage .= "<font color=\"red\"><b>Mail has NOT been sent to $to</b></font><br /><br />";
}