We are using php mail function to send emails to our customers. Few days ago, we've found that email are not delivered to only hotmail.com domain. I've checked email log to see if there are any error messages, and here is what I've found:
Aug 30 23:02:50 XXX sendmail[35378]: AXXX: to=<XX@hotmail.com>, ctladdr=<apache@XXX> (48/48), delay=00:00:05, xdelay=00:00:05, mailer=esmtp, pri=121148, relay=mx.XXX. [], dsn=5.6.0, stat=Data format error
Aug 30 23:02:50 sendmail[35378]: DSN: Data format error
What is this Data format error and how it can be fixed? What is this ctladdr and do I need to set it using PHP or not? Do I need to contact my server provider about this issue, or this is my php application related issue?
My PHP code for sending the emails is:
function send_email( $name_from, $email_from, $email_to, $subject, $message, $headers="" ) {
$returnVal = 0;
// made it through validation, send email
$subject = trim( $subject );
$message = trim( $message );
$headers .= "FROM: $name_from <$email_from>";
if( mail( "$email_to", "$subject", "$message", "$headers") or die ( trigger_error ( "Error: ", E_USER_ERROR ))) {
$returnVal = 1;
}
return $returnVal;
}
As you can see in my $headers
I set the FROM field.
Thx for answers?