How to send emails from different custom subdomains? (sendgrid)

Viewed 3283

I have a domain (ex:- mydomain.com). I am using sendgrid mail service to send and receive mails. When I send any mail using sendgrid V3 API from address user@mydomain.com it is working fine. But I when try to use sub-domain user@username.mydomain.com sendgrid throwing 403 error (domain is not authenticated). Looks like it is accepting only root domain with out any subdomains. I would like to send emails from different custom subdomains.(like freshdesk and zendesk which allocates a different sub-domain for every user). Is there any way that I can overcome this probelm ?

Any little help would really be appreciated.

3 Answers

According to the info at SendGrid's Knowledge Center, you should be able to resolve your issue by properly setting up CNAME records for your sub-domains so that they point to sendgrid.net. See https://sendgrid.com/docs/glossary/cname/ for details.

Basically you need to 1) create a sub user 2) for the newly created sub user, go to Setting -> Sender Authentication to create your subdomain.

Then you need to go to Setting -> API Key to retrieve the access token for the new sub user. And use that access token when you send email and make sure to use the From address such as user@username.mydomain.com

You have to verify your subdomain also, similar as you verified your domain.

There will be 3 CNAME records given to you by Sendgrid which you can add into you DNS records in your domain. (Only add first CNAME records Don't add last 2 records as it will be same as you already added for domain while domain(mydomain.com) verification

TYPE - CNAME
HOST - username.mydomain.com
VALUE - u2444223323.wl65.sendgrid.net

Related