Mail Sender Policy Framework (SPF) with SendGrid and O365

TLDR; add txt v=spf1

1. Add TXT Record in your domain.

2. In TXT content add the following where <domain> is a domain that is allowed to send email on your behalf.

v=spf1 include:<domain> –all

Example for office 365:

v=spf1 –all

3.  for multiple records, use space + another include:<domain>

v=spf1 include:<domain><space>include:<domain><space> –all

Example for office 365 with Send Grid (All):

v=spf1 –all

I would consider that having the entire domain may not be a good practice, follow the steps below on having only use your own sendgrid account listed in your SPF record.

Long Version:

So, yes, email spam. I have a new project that will require sendgrid and as I remember, one of the challenges in using a third party mailing service is that your email may end up on spam semi-defeating the purpose of your email sender. Since Email on the internet can be forged in a number of ways (RFC7208)

So according to send grid you need to do 2 things (1 & 2): #3 here is for working with another service that uses your domain and #4 is for testing. 

1. Domain Verifications –> which you can do at (please login) where you add a bunch of CNAMES in your domain DNS that points back to

Please note of your record. You will be needing that on step #2



2. Add SPF on your domain.

On your domain registrar, add a new TXT record with the value:

v=spf1 include:<domain> –all

The <domain> here is the mail sender.

According to SendGrid documentation, you need to add the – for example:

v=spf1 –all

You can find your “”  during your domain validation.

3. If using with Office 365.

So this domain is linked to an Office 365 E3 account which means it has an Exchange Online service. In order to use both O365 and Sendgrid together, both domains must be appended as an include in your SPF TXT record with this format:

v=spf1 include:<domain><space>include:<domain><space> –all

For an example:

v=spf1 -all

4. Testing. There are a number of domain tools out there. I use ol’reliable MX Toolbox:


On the dropdown, choose SPF Record Lookup. Enter your domain and check if your SPF is already there. This is an example result of a configured SPF with Outlook and SendGrid.


So hey, stop spamming and use SPF. Try it out.


PS/ On the mail internet headers (Email/Outlook > File > Properties) You should see the following:


Green highlight is the domain used in SendGrid.


Published by


Hi, I'm John. I am a developer, currently creating digital assets that protects people and their future. I am a certified SAFe Agilist, completing my LOMA certification, Microsoft Certified Developer (MCTS, MCPD), Azure certified and Microsoft Certified Trainer (MCT) alumni. I'm also a Microsoft MVP awardee for 8 years specializing Software Packaging, Deployment & Servicing as well as Cloud & Datacenter Management. Disclaimer: This is a personal blog. The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way. All content provided on this blog is for personal content and makes no representation as the accuracy or completeness of any information on this blog or found by following any link on this site.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s