SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    0 Post(s)
    0 Thread(s)

    Using PHP mail script and email is not being delivered to 1 of 6 listed recipients

    Ok, so I'm kinda stumped and could really use some help. I set up a PHP mail script on my own server and everything worked great. Then when I moved it to my client's server, one of the email addresses in the script no longer receives the generated message. There are 6 recipients in total on various domains including google, godaddy, etc. All of the email addresses received the PHP mail when the script was hosted on my own server, but one of them stopped receiving the PHP mail once I moved the script to my client's server.

    I am providing a copy of the script and the bounceback message that was received once I moved the script over (email addresses omitted for privacy). I am able to send messages directly from my email address to the recipient, however I cannot use the script to do it. Any suggestions on why this is happening? Thanks in advance!

    PHP Code:
    $subject "Test mail";
    $message "Hello! This is a simple email message.";
    $from "";
    $headers "From:" $from;
    "Mail Sent.";

    I received this bounceback after transferring the script to the client's server:

    This message was created automatically by mail delivery software.

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:
    No Such User Here

    ------ This is a copy of the message, including all the headers. ------

    Return-path: <>
    Received: from username by with local (Exim 4.69)
    (envelope-from <>)
    id 1UAqjf-0000Jp-KV; Wed, 27 Feb 2013 18:48:31 -0500
    Subject: Test mail
    Message-Id: <>
    Date: Wed, 27 Feb 2013 18:48:31 -0500

    Hello! This is a simple email message.

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    0 Post(s)
    0 Thread(s)
    Ok, so I have fixed the problem. After extensive research and investigation, the issue stems from the client's email being hosted on a different server than the website and is not connected to the php code in any way. The hosting server, being a dumb robot, assumes that because the client's website and email both have the same domain name that they are both hosted on the same web hosting server, and therefore tries to send the message locally. I found the setting in the control panel for the client's web hosting where I can change it from a local mail exchange to a remote mail exchange. This told the client's web server to send the email out into the net and allow the email to direct itself to the proper location, rather than just dumping it into a non-existent email account on the client's web hosting server.

    Thanks all,



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts