Sending emails from my domain with SendGrid - email

I have a question that I guess is not just related to SendGrid.
Say, I own the mydomain.com domain, and I want to be able to send emails from, for example, team#mydomain.com.
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 the documentation, 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 (team#mydomain.com)? Is it compatible to have both (Gmail and Sendgrid) configuration in my domain?
Why don't I need to add any MX records for SendGrid?

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.

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.

Related

My Domain Emails using Google Apps Business are getting sent to spam by the gmail recipient

I just found out my domain's emails have been going to the spam folder of gmail recipients. I did some research and I put the following in my DNS records for my domain name:
TXT - "v=spf1 include:_spf.google.com ~all"
I'm not sure if I have to put anything before the spf like my server's IP address or a or mx in some configurations I see. I mainly use my google apps domain email by using my plain gmail account and set "Send As" to send from the domain specific emails.
Is there something else I am missing or overlooking that I need to do to resolve this issue?
If you're only using google apps to send emails then that's the correct SPF record.
If you want to be sure, the best thing you can do is send an email to
mailtest#unlocktheinbox.com
check-auth#verifier.port25.com
They are know as reflectors and will auto-respond with your configuration, letting you know if you have your SPF set up correctly.
If you're unsure of what you need just use an SPF Wizard, but I think based on your description you're 100% fine. The MX and A just tells the receiving mail server that if the mail comes from you MX or A of your domain, then it's a good email, but you're sending from google, so you wouldn't need it.
Also with GMAIL in-boxing takes time and SPF isn't the magic cure, but it helps.

Mailgun messages from subdomain without MX record get rejected by some mail-providers

I'd like to use Mailgun to send e-mails from a web application, sending newsletters as well as transactional mails.
I set up a sudomain "subdomain.domain.tld" and configured the DNS as specified on the Mailgun panel, except for the (optional) MX record needed to recieve mail at that subdomain.
This is because the current hoster/domain-registrar doesn't allow setting an MX record for subdomains, just for the main domain.
Their support says something like 'We don't care about this, deal with it.'.
I don't want to configure the main domain for the use by Mailgun, as the client is recieving regular e-mail the main domain that is handled by other servers.
The current setup allows me to send mail using mailgun with the "From"-address "mail#domain.tld" to most major E-Mail providers including Gmail, Yahoo and Hotmail.
However the mails get rejected by some providers (e.g. mail.ru, freenet.de or arcor.de), with an error messages like the following:
<bounce+gibberish-user#=provider#subdomain.domain.tld>: Sender address rejected: Domain not found
Other providers have slightly different messages, but point to the same problem:
Domain of sender address [..] does not exist.
Unrouteable mail domain, verifying bounce failed
Unroutable sender address
It seems to me that the mails get rejected because of the missing MX record for subdomain.domain.tld , as used within the bounce address.
How do I solve this problem without moving the complete domain to another registrar that allows me to change MX records for subdomains?
I would really like to avoid this.
Is it possible to configure mailgun to use different bounce addresses that are actually valid independent of my MX records?
For example bounce-gibberish-mydomain-tld#mailgun.com instead of bounce-gibberish#mydomain.tld?
Three possible solutions, in order of preference:
Find a different DNS provider, that will allow you to put an MX on a subdomain. Note that this does not necessarily require you to change registrars.
Use your base domain with mailgun, perhaps utilizing their forwarding feature to send incoming mails to whoever hosts your mailboxes.
Use someone other than mailgun, that will allow the bounce address to be set to their domain instead of yours.
My setup:
root MX set up for gmail. Sends and receives as #mydomain.com
added mailgun and delivers as #mg.mydomain.com
getting bounces when doing mailgun sends to certain email providers (e.g. sbcglobal.net) because as mailgun said, don't add MX record if I already have another email service set up to use MX records.
My fix:
Contacted godaddy support. They told me I could add more MX records for my subdomain. Instead of MX # mxa.mailgun , it's MX mg mxa.mailgun
Hope this helps.
I ran into the same issue. In my case I'm using Office 365 for receiving emails and Mailgun to send emails. Here is my DNS config for my Mailgun subdomain mg.{name}.com which solved the problem:
email IN CNAME mailgun.org.
email.mg IN CNAME mailgun.org.
mg IN CNAME mailgun.org.
# IN MX 0 {name}-com.mail.protection.outlook.com.
# IN MX 10 mxb.mailgun.org.
# IN MX 10 mxa.mailgun.org.
# IN TXT "v=spf1 include:spf.protection.outlook.com include:mailgun.org ~all"
krs._domainkey.mg IN TXT "k=rsa; p={insert the value from mailgun here}"
One very important thing, is that you can't have two SPF lines in your config. I had to merge these two lines...
# IN TXT "v=spf1 include:spf.protection.outlook.com -all"
# IN TXT "v=spf1 include:mailgun.org ~all"
into one...
# IN TXT "v=spf1 include:spf.protection.outlook.com include:mailgun.org ~all"

Receive (not forward) e-mail using Mailgun

I want to use Mailgun to send/receive messages programatically via API.
BUT I need to have also some mailboxes available using Thunderbird or other mail client.
For example I want to have user mailboxes at:
support#
sales#
admin#
And all other e-mails will be for API send/receive.
I can not forward my mail to GMail because I need to reply from the same address (sales#mydomain.com).
Please help.
There is a limitation to using the routing feature and that is that if you delegate a domain to be used by Mailgun you cannot use it with an email client.
That means that, for example, if you want to route emails to user#domain.com and then still use that email address with your favourite email client (be it Thunderbird, Outlook or Gmail) you can't do it. That is because of the way you've configured your MX records (email records in your DNS).
When you use Mailgun's routing functionality you delegate MX records to mailgun, which receives your emails, parses them and routes them according to your preferences.
So how do we solve your problem?
What you can do instead is set up your MX record on a subdomain.
Using subdomain.mydomain.com and pointing its MX records to mailgun will allow you to receive and parse emails through Mailgun.
This way you can have:
admin#subdomain.mydomain.com
sales#subdomain.mydomain.com
etc
will be handled by mailgun
while
admin#mydomain.com
sales#mydomain.com
will be handled normally with your email client.
Please do not hesitate in asking more details!
You need to configure your MX record settings for your subdomains in your DNS control panel.

How do I setup Mandrill MX records and keep my old email?

I setup MX records for my domain.
According to the tutorial, all other records should be removed.
I removed the old records and have since realized that I still want a regular e-mail account,
info#mydomain.com
How do I setup my MX records to handle this?
Mandrill's tutorial said that no other MX records are allowed.. I want to have info#mydomain route exist as well.
It's not possible to have a traditional inbox for a domain as well as have Mandrill accept email for that domain. Instead, you'll likely want to have Mandrill handle only a subdomain, like inbound.domain.com, and set up the routes for that subdomain. Your root domain could then be used for traditional inboxes for sending and receiving mail.
Alternately, you can set up your root domain to be handled by Mandrill. Whenever you get mail to info#yourdomain.com, you'd process the webhook POST, and use the information from that POST to create a new outbound message to some other inbox where you can receive mail.

SPF record for an mail server

I use a different server to send mail to my mailing list. I want to add an SPF record to my domain to show that the IP of the different server is authorized to send mail (as well as the default server).
The server sending email in the example is 1.2.3.4 with the main domain of test.co.uk.
So far I have v=spf1 mx a ip4:1.2.3.4/32 mx:test.co.uk ?all", would this work for what I want?
EDIT:
I would be sending mail using sendmail. The SPF record would be to increase % of mail going to inbox and also so we can enforce -all in the near future on SPF.
Try using an online tool like http://www.mtgsy.net/dns/spfwizard.php to generate the SPF record. If you Google for "SPF Record checker", you will find many websites which will even validate the SPF record for your domain.
Let's assume your domain is test.co.uk. This makes mx the same as mx:test.co.uk. Specifying an IP as ip4:1.2.3.4 is the same as ip4:1.2.3.4/32.
That would be enough:
v=spf1 mx a ip4:1.2.3.4 ?all
Make sure you verify your SPF records using a SPF checker. Try the following one.
http://spf.myisp.ch
It does some pretty extensive testing.