6

I have a GoDaddy Office 365 email account test@mydomain.com and am using PHPMailer to send out emails using SMTP.

Emails are hitting spam folders whenever my script sends them out, in the headers I can see the following message...

Received-SPF: None (protection.outlook.com: mydomain.com does not
 designate permitted sender hosts)

The script is running from another domain mydomain2.com, I have 2 SPF records on mydomain.com set up that look like this...

v=spf1 include:spf.protection.outlook.com -all
v=spf1 include:mydomain2.com -all

Where am I going wrong? Do the records need to merged?

fightstarr20
  • 11,682
  • 40
  • 154
  • 278

1 Answers1

9

Yes, they do need to be merged. Merging those would look like this:

v=spf1 include:spf.protection.outlook.com include:mydomain2.com -all

Are you sure that's what you mean though? include:mydomain2.com does not mean "allow sending from mydomain2.com"; it means "allow sending from the servers listed in the SPF record for mydomain2.com", which may be entirely different. It wouldn't surprise me if you needed to add an a clause, or possibly an mx instead of that include, but I can't tell from the info you've posted.

Update - to simply designate the host that the domain points at as a sending host, and also the inbound mail server for your domain, do this instead:

v=spf1 a mx include:spf.protection.outlook.com -all
Synchro
  • 35,538
  • 15
  • 81
  • 104
  • Yep thats exactly what I am trying to do 'allow sending from mydomain2.com' - Explains why things aren't working now – fightstarr20 Oct 17 '17 at 17:02
  • Is this SPF record to be updated on mydomain.com rather than mydomain2.com? – fightstarr20 Oct 17 '17 at 17:08
  • 1
    It should be on whatever domain your from address is using, so if it's `test@mydomain.com`, it would be in the SPF record for `mydomain.com`. – Synchro Oct 17 '17 at 17:21
  • 1
    this tool is the spiffiest for creating an SPF https://www.spfwizard.net/ I would create both an SPF and TXT records for the domain sending the emails. Can test your SPF here https://www.kitterman.com/spf/validate.html – Stan Quinn Jul 21 '19 at 02:38
  • Don’t bother creating SPF-type records. They are often not supported by DNS services, and are now deprecated anyway; stick to TXT type records. – Synchro Jul 21 '19 at 10:50