Sign-up to [[SendGrid]] and then Sign-in.
You should own a publicly available domain name, let's assume it is hosted with [[Cloudflare]] and is named <code class="w-code">mdn.com</code>.
# Domain Setup
> [!attention] **DO NOT select Single Sender Verification as emails will not be delivered.**
<button class="navigate">Get Started</button>
![[sendgrid-authentication-00.png]]
<button class="navigate">Next</button>
![[sendgrid-authentication-01.png]]
<button class="navigate">Next</button>
![[sendgrid-authentication-02.png]]
![[sendgrid-authentication-03.png]]
Add the above [[DNS]] records in the domain zone in [[Cloudflare]]. If you had enabled the [[e-mail]] security settings for the domain in [[Cloudflare]], the last record will already be in your domain DNS zone.
<button class="navigate">Add Record</button>
![[sendgrid-cloudflare-0.png]]
Add all 5 or 6 [[DNS]] records. <button class="navigate">Save</button>
![[sendgrid-cloudflare-1.png]]
<button class="navigate">Verify</button>
![[sendgrid-authentication-04.png]]
If successful you will see a confirmation, otherwise you will be prompted which records are not correct.
<button class="navigate">Return to Sender Authentication</button>
![[sendgrid-authentication-05.png]]
Complete setup of incomplete Pending configuration settings.
![[sendgrid-authentication-10.png]]
Add all Pending settings to [[Cloudflare]] [[DNS]] domain-zone.
![[sendgrid-authentication-11.png]]
<button class="navigate">Verify</button>
![[sendgrid-authentication-12.png]]
If the [[DNS]] records were added to [[Cloudflare]] properly you will get a success notification.
![[sendgrid-authentication-05.png]]
Verify all tasks completed and crucially Domain Authentication.
![[sendgrid-authentication-13.png]]
# [[SMTP]] Setup
To be able to send [[e-mail]]s one more task requires completion. <button class="navigate">Choose</button>
![[sendgrid-smtp-0.png]]
<button class="navigate">Create Key</button>
![[sendgrid-smtp-1.png]]
Copy the generated key as we need it for the verification test.
![[sendgrid-smtp-2.png]]
# [[SMTP]] Test
To test you can send and receive email, head over to [GMass SMTP Test Tool](https://www.gmass.co/smtp-test). <button class="navigate">Test it</button>
![[sendgrid-gmass-0.png]]
If [[e-mail]] can reach the destination, successfully or unsuccessfully, you will see it in the output, which should provide enough information to troubleshoot errors.
![[sendgrid-gmass-1.png]]
<button class="navigate">Next: Verify Integration</button>
![[sendgrid-smtp-3.png]]
<button class="navigate">Verify Integration</button>
![[sendgrid-smtp-4.png]]
Be patient... This test can sometimes take a bit of time to complete. If it times out with an error attempt to re-test a couple of times.
![[sendgrid-smtp-5.png]]
If everything goes according to plan you should have confirmation everything works!
![[sendgrid-smtp-6.png]]
API keys can be managed through a configuration page.
![[sendgrid-apikeys-0.png]]
![[SendGrid#References]]
# Follow or Support me -> <a href='https://ko-fi.com/S6S0K9U5Q' target='_blank'><img height='36' style='border:0px;height:36px;float:right; ' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>