Emails sent using the PHP mail() function are marked as spam
I believed I have set up everything correctly, but it seems I am missing something.
- I set up my DNS, MX server and SPF this way:
<img alt="Alt text" src="http://az.co.cz/smazat/1/Clipboard01.png">
If I understand the SPF syntax well, it seems that emails sent from elasticemail.com and my MX servers should pass.
- But all emails sent using the PHP mail() function are marked as spam. This is the first dmarc report from Gmail I have received - it seems that the email did not pass the SPF check.
<img alt="Alt text" src="http://az.co.cz/smazat/1/Clipboard02.png">
- On the other hand, when I use the "show original" menu in Gmail, it says SPF: PASS.
<img alt="Alt text" src="http://az.co.cz/smazat/1/Clipboard03.png">
So, I don't understand two things:
- Is there something wrong with my SPF settings?
- Why the messages end in the SPAM folder when I have set up SPF, DKIM and DMARC?
This can happen for many reasons using the PHP mail() function. It's also a bit hard to narrow down without some further information.
What mail providers are marking these emails as spam?
Are there any mail providers that don't mark it as spam?
If you're looking to validate your records MX toolbox has some tools that should help you do this.