When creating a mail with PHPMailer my emails are getting sent to the spam folder of my recipients mailbox

I have been told I need to configure my SPF and DKIM correctly, I think I have done this already on my GoDaddy account for SPF - @ v=spf1 a mx ptr include:secureserver.net ~all

Has anyone else got any ideas why my mail might be going to spam? Have I missed out any headers that you can tell?

Thank You

Thanks for your help

  • The SPF record for your domain does not match the one in your question. – Andrew Domaszek Nov 27 '14 at 19:38

The reason for the failure is:

Authentication-Results: hotmail.com; spf=softfail (sender IP is smtp.mailfrom=no-reply@example.com; dkim=none header.d=example.com; x-hmca=fail header.id=no-reply@example.com

The IP address does not appear in your SPF record as either a (, mx(mail.example.com which resolves to, ptr (p-23-229-191-2.ip.secureserver.net), or the stated domain of secureserver.net.

There may be other solutions, but one simple one is to add the IP address to your SPF record.

v=spf1 a mx ptr IP4: ptr:secureserver.net ~all

You can test SPF records at http://www.kitterman.com/spf/validate.html. My previous edit of using the include mechanism is not correct because secureserver.net does not have a valid SPF record. Apparently the record for example.com has already been changed to something similar to the above recommendation using the ptr and IP4: mechanisms.

No DKIM header is present. You can test your DKIM configuration at http://dkimcore.org/tools/ among other places, but the problem of the header not being present is a server configuration issue that is probably resolved by referring to the documentation for the various tools you are using.

It is also important to note that there is no guaranteed way to not arrive in spam folders other than to develop a good reputation and gain the trust of the various email providers. SPF and DKIM help primarily because they offer some protection against spammers that may try and use your domain in their spamming efforts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.