SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    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:
    <?php
    $to 
    "client@client.com,myemail1@myemail1.com,myemail2@myemail2.com,myemail3@myemail3.com";
    $subject "Test mail";
    $message "Hello! This is a simple email message.";
    $from "me@me.com";
    $headers "From:" $from;
    mail($to,$subject,$message,$headers"-fme@me.com");
    echo 
    "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:

    client@client.com
    No Such User Here

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

    Return-path: <me@me.com>
    Received: from username by hostingserver.com with local (Exim 4.69)
    (envelope-from <me@me.com>)
    id 1UAqjf-0000Jp-KV; Wed, 27 Feb 2013 18:48:31 -0500
    To: client@client.com,myemail1@myemail1....3@myemail3.com
    Subject: Test mail
    From:me@me.com
    Message-Id: <E1UAqjf-0000Jp-KV@hostingserver.com>
    Date: Wed, 27 Feb 2013 18:48:31 -0500

    Hello! This is a simple email message.

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    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,

    -NewLogic87


Bookmarks

Posting Permissions

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