1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Not receiving email sent from PHP mail() after cPanel migration?

Discussion in 'PHP' started by TheDataPlanet.com, Nov 28, 2014.

  1. #1
    I just moved my site example.com from one host to another by cPanel account backup and restore. Name servers are changed a few hours ago. is hosted at Google apps with MX records pointing to aspmx.l.google.com., etc.

    Name servers change seems to have propagated because the website is working fine from the new server. However, there's something weirdly wrong with emails:

    1. Emails sent from my Gmail (a native Gmail account) to are correctly received.
    2. I can then log in Google apps to view the inbox of , see the message and send a reply back to which is again correctly received.
    3. Emails sent to by PHP mail() from the new server are correctly received, with proper 'mailed-by' and 'signed-by' fields in Gmail.
    4. Emails sent to by PHP mail() from the new server are NOT received at all, NOT EVEN in spam.

    This is really weird because both and mail() seem to be working fine individually but when you mail() to the message just doesn't arrive.

    Any idea why? Is it the DNS propagation or is there anything internally wrong with my server or code? Do I need just wait or do I need to do something?
     
    TheDataPlanet.com, Nov 28, 2014 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    First of all you should check the logs of sent emails on the server, to see if there are any errors.
     
    PoPSiCLe, Nov 28, 2014 IP
  3. TheDataPlanet.com

    TheDataPlanet.com Well-Known Member

    Messages:
    503
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Thanks for the help. Where do I look for the mail logs?
     
    TheDataPlanet.com, Nov 28, 2014 IP
  4. TheDataPlanet.com

    TheDataPlanet.com Well-Known Member

    Messages:
    503
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #4
    Seems it's the problem of DNS propagation that had yet to be completed. That's why mail() couldn't resolve . I waited some more time and it's working now.
     
    TheDataPlanet.com, Nov 29, 2014 IP
  5. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #5
    Double check the DNS MX records. Check the apache error logs in case the script is throwing an error you can't see. Check the mail log.

    The apache error log should be available in your cpanel account. The mail log is normally only available if you have root access to the server, typically under: /var/log/maillog
     
    jestep, Dec 3, 2014 IP
  6. ezprint2008

    ezprint2008 Well-Known Member

    Messages:
    611
    Likes Received:
    15
    Best Answers:
    2
    Trophy Points:
    140
    Digital Goods:
    1
    #6
    thats common when you first set up a new site on godaddy, lunarpages etc ..the PHP Mailer()
    will send to gmails etc but not to its own server.
     
    ezprint2008, Jan 12, 2015 IP