My first post and I think I have researched it and tried to eliminate most things. My client has a PHP Contact Form but the submissions are never being received.
This is the code for the mailer.
// subject
$subject = 'Contact Information';
// message
$message = 'Hi, <br><br> Please have a look on below. <br><br> Contact Us: '.$_POST['option1'].'<br><br> Message:'.$_POST['message'].' <br><br> Thanks';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To:'.$to. "\r\n";
$headers .= 'From: office@example.com' . "\r\n";
// Mail it
$nail = mail($to, $subject, $message, $headers);*/
$to = ' office@example.com' ;
// subject
$subject = 'Contact Information';
// message
$message = 'Hi, <br><br> Please have a look on below. <br><br> Contact Us: '.$_POST['option1'].'<br><br> Message:'.$_POST['message'].' <br><br> Thanks';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To:'.$to. "\r\n";
$headers .= 'From: '.$_POST['email']. "\r\n";
This is what happens:
- Sent email to office@example.com via normal means (eg: Gmail) and MAIL IS RECEIVED
- Change the recipient address from office@example.com to say sales@newdomain.com and MAIL IS RECEIVED FROM CONTACT FORM
- Change the recipient address to sales@example.com and MAIL IS NOT RECEIVED FROM CONTACT FORM
In all cases the form responds that Mail Has Been Sent.
It is hosted with GoDaddy, and it seems the mail service must be working as we can receive the submissions if sent to another domain.
Any ideas why we can't get emails sent to the example.com.domain. The form is hosted on example.com as well - or is there some kind of error in the send code?
Ernie