Sending emails from my domain with SendGrid

10,611

Solution 1

First and foremost, the MX records for your domain are used only to specify the hostnames of the servers to handle INCOMING mail for your domain - i.e. the MX records have nothing to do with the servers that are used to send outgoing mail. You can use both Gmail's outgoing mail servers and Sendgrid's outgoing mail servers (and any other outgoing SMTP servers for that matter) to send outgoing mail for you domain. The only caveat to this is if you have an SPF record setup for your domain, but you didn't mention one so I won't elaborate.

Solution 2

MX records, as stated previously, are for specifying a server that handles INCOMING emails. You can use Sendgrid to send outgoing emails together with an email account service like Gmail. With Gmail, you would both send and receive emails. With Sendgrid, you would only send emails.

the MX records for the domain would be specified as those for Gmail/Google. The trick is in correctly configuring the SPF records, which is a TXT type record in the domain name. In the SPF record, you would include both Gmail/Google info as well as Sendgrid info on the same line.

So, say you only used Gmail for sending and receiving email, your SPF record would look something like this:

v=spf1 include:_spf.google.com ~all

However, if you add another server from another service, say Sendgrid, in order to also send verified emails for that domain, the SPF would be altered to something like this:

v=spf1 include:_spf.google.com include:u826348.wl.sendgrid.net -all

In both of these examples, only the GMail/Google MX records would be added to the DNS records.

Share:
10,611

Related videos on Youtube

Hommer Smith
Author by

Hommer Smith

Updated on June 04, 2022

Comments

  • Hommer Smith
    Hommer Smith almost 2 years

    I have a question that I guess is not just related to SendGrid.

    Say, I own a domain mydomain.com. If I want to be able to send emails from, for example, [email protected].

    Right now, when I go and manage my domain, I can see that I have added some MX record values added there. By doing this, I am able to send email using Gmail.

    However, with Sendgrid I find this a little bit more confusing. I have read through this: http://sendgrid.com/docs/User_Guide/whitelabel_wizard.html -- But I fail to see what should I do. I am using NameCheap, and all it comes to my mind is the following:

    -> If I want to use Sendgrid to send emails from my application (Ruby on Rails), will I still be able to access my Gmail account and send emails using the same address ([email protected])? I mean, is it compatible to have both (Gmail and Sendgrid) configuration in my domain?

    -> Why with Sendgrid I don't need to add any MX records?

  • mrwaim
    mrwaim almost 9 years
    Do mail clients check the MX record to determine if the sender is not spam? I got that impression from reading about MX
  • gleenn
    gleenn over 7 years
    The SPF record mentioned is the thing that is used to verify the sender is not faking an email address as a spammer might try to do. Pretty sure this is not the MX record, but is similarly setup in a domain name server.