0

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

  • 1
    send a mail to sales@example.com from your gmail account,manually, then check is there any failure return in gmail – developerCK May 05 '16 at 03:59
  • Hi: Mail to sent from Gmail direct to any of the email addresses arrives OK. For some reason it's only to the @example.com addresses it fails to deliver from the Contact Form (and the Contact Form is ON example.com so that is where they have to go!) – Ernie Sugrue May 05 '16 at 07:41

0 Answers0