Sending Reliable Emails With Magento
Contents
Email basics
Background info
Some basics to start with:
- PHP (which Magento runs on) used to be able to send emails via one-line of code.
- This was a major cause of global spam (as it didn't need a user/pass to send).
- Most receiving email servers will now flag any email sent like this as a major spam flag.
- ie. there's a high chance your emails won't be delivered.
- If you're also sending (non-Magento) business email with the same sending domain (eg. your-site.com), there's a good chance the delivery of those emails will also be impacted, due to the flagging of other emails.
- A lot of hosts will also block emails sent that way from being sent, so that their servers aren't blacklisted.
- Default Magento sends emails with this system.
- That's right. If you haven't specifically added a way to authenticate (with user & password) the emails you're sending with Magento, then it's likely that both transactional emails from Magento, and your regular company emails, are not all being delivered.
Check your current status
Have a quick check to see if your domain is blacklisted: Email server blacklist checker
Here's an example of a blacklisted email server (this domain will have deliverability issues).
Action plan
Use a separate sub-domain to send emails
You should use a different subdomain for transactional emails, marketing emails, and business emails.
The aim here is if one get's blacklisted, the other ones can carry on.
eg. if your site is example.com then you might want to setup subdomains for:
- Optimal:
- e.example.com (transactional emails)
- e.example.net (outreach emails)
- mail.example.com (main biz emails)
- Good:
- e.example.com (transactional emails)
- email.example.com (outreach emails)
- example.com (main biz emails)
If you're not familiar with setting up DNS for different subdomains, I recommend checking DnsMadeEasy.com. Your main domain registrar likely also has the ability to setup and direct multiple subdomains.
Check that you can send & receive email at each of those (sub)domains.
Setup an email sending service
You now need to setup an email sending service for your transactional emails (ie. the emails that Magento sends).
These guys ensure the email servers are live, off blacklists, and generally make sure your emails get sent.
I recommend MailGun but there's a bunch out there, eg. Mandrill, SendGrid.
You'll need to configure some settings in your DNS provider (dnsMadeEasy or your domain registrar) to verify your ownership to Mailgun.
Setup Magento to connect to Mailgun
- Get Magento connected to your email sender
- * I recommend SMTPpro. It's a free plugin and works great.
- Once you've got it installed, head to the config section of that plugin and enter your MailGun settings.
- Check it's all working - make a test order, check that you get the correct emails.
- Log into MailGun and check the activity, check you see the emails you're expecting to see
- * This is going to be useful in the future if you think you have email delivery issues - you can see exactly what has been sent to who, from Magento.
- In your receiving email app (where you are receiving the test transactional emails), look at the raw message contents. Check that everything looks as you want it to, as a representation of your business (eg. sender name, reply-to email, etc).