Hi,
I am trying to send an email to a distribution list, located on an Exchange server. The program that sends the email does not return an error but no email is received. Here is what I am using:
<?php
header("Pragma: no-cache");
$mail_to = "Shopping@mydomain.com";
$mail_subject = "Online order from Shopper";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1\r\n";
$headers .= "From: ";
$headers .= "Shopping@mydomain.com";
//$headers .= "name@another_domain.com";
$headers .= "\r\n";
$mail_body = "This is a test email sent from a php file to test send/receive functionality of [email]shopping@mydomain.com[/email]";
if (!mail($mail_to, $mail_subject, $mail_body, $headers))
echo "Mail send failed!";
else
echo "Mail successfully sent to [email]Shopping@mydomain.com[/email]";
?>
When I run this test program, it prints "Mail successfully sent to Shopping@mydomain.com", but no email is received. If I use Outlook and send an email to the above email address, it goes through with no problem. I checked the junk folder to see if Exchange takes the email as junk, but nothing there either.
What am I doing wrong?
TIA.