PHP mail not showing up at Gmail but shows up at Hotmail and other 3rd party/ISP account

emailgmailPHP

I have 2 sites where mail is sent to two vanity gmail accounts. I'm using PHP to handle the mail, but the mail is not showing up at gmail (not in spam/junk, it just doesn't show up). If I switch the PHP to send to my personal hotmail account, the mail shows up. Same for a personal email account through my ISP.

The mail used to show up at those 2 vanity gmail accounts, any ideas why they would just stop?

Best Answer

There is a possibility you did not set proper header data, and those emails are blocked even before reaching spam folder.

Try adding something like this:

$headers = 'From: your@email.com' . "\r\n" .
'Reply-To: some@email.com';

This is the fourth parameter of mail() function.

Related Topic