I am working on a PHP script, which I have stripped down to just the emailing function for troubleshooting. My problem is that when I send the email to the desired address, it doesn't go through. However, if I switch the receiver address to my gmail account, it works perfectly. I have sent test emails to the desired address, which go through, and work perfectly.
Note that I have changed the email address below. This does not work.
$emailFrom = "sender@domain.com";
$emailTo = "receiver@domain.com" ;
$emailSubject = "KMV - New Prints Order!";
$emailMessage = "Hello, World!";
$emailHeaders = 'From: '.$emailFrom."\r\n".
'Reply-To: '.$emailFrom."\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($emailTo, $emailSubject, $emailMessage, $emailHeaders);
However if I change one line as follows:
$emailTo = "myAddress@gmail.com" ;
It works.
I'm lost as to what could be causing this issue.