I am trying to send an email in following way -
from : xyz@domain1.com
reply-to : xyz@domain1.com
to : abc@domain2.com
cc : abc@domain3.com
My email is getting delivered to the address mentioned in CC (If I replace the emails to and cc, then email is sent to the address mentioned in to)
For some reason, email is not getting delivered to the address abc@domain2.com. If I send the email manually to this address using outlook or gmail, then email is actually delivered. How can I debug this issue ?
I checked spam/junk directories as well, no emails over there. I tried using php mail() function as well as phpmailer class. Both of them return TRUE. What could the reason ? Please help.
$mail->From = "xyz@domain1.com";
$mail->AddReplyTo("xyz@domain1.com");
$mail->AddAddress("abc@domain2.com");
$mail->AddCC("abc@domain3.com");
$mail->Subject = $subject;
$mail->Body = $message;
if(! $mail->Send()) {
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}