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?
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.
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
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.