You might be thinking why bother talking about sending e-mails in our current digital age. There are so many alternatives nowadays. Email is dead, long live email!
But is Email really dead?
Email has been around since 1971. It evolved and it's still quite alive thank you. E-mail has outlasted thousands of different systems. Email will be in existence even after all social media and other chat systems are replaced.
E-mail won't perish due to this simple fact. It's a central repository of all your accounts containing an interesting history. People use it for everything.
Even if there are people claiming it's no longer in use. I wonder how they create new accounts?
Marketing is still keeping e-mail alive. And there are a plethora of services which offer e-mail services.
With the 281 billion e-mails sent per day in 2018, I doubt these folks who proclaim that "email is dead".
What will change is how e-mail is handled and the systems we will use to do that. That is another whole discussion meant for another time. Email is still reliable.
Spam and reliability
What has changed is the fact that there is so much spam around. This spam is filtered by intelligent spam filters and most of the time it doesn't even touch our inbox.
These spam filters are self-updated with artificial intelligence each day. This means that sometimes it might happen that even a genuine e-mail gets flagged as spam.
Now what happens is that most people send e-mail from within an application via the builtin mail functions?
Which on Linux happens via the sendmail function.
Most servers are probably not properly set up. Which can mean that most emails you send will go into spam or not even arrive in the junk folder.
This can cause massive problems for most online apps. And it's beginning to occur more and more often as hosting companies are also triggered by people sending spam.
NOTE: I do NOT advocate following this article/tutorial and sending spam. This is meant for legitimate e-mails where you have a predefined mailing list.
Note that the GDPR will catch up to you if you send spam.
A simple solution would be to use an SMTP library instead... And this is where the fun starts.
Solutions for sending reliable e-mail
The best way to send e-mails from your Application/Hosting/Website/VPS depends on your experience and the setup.
I've had experience in managing Servers and VPS'es for clients and for my own projects. When it comes to sending e-mails this has become rather tricky in the last years.
Cheap hostings (read $2-5 per month) usually have an hourly limit. This should be enough for most legitimate users.
The problem is not the limit but the way SMTP servers interact with each other. Sending e-mails from PHP with the mail function is no longer enough so that each mail is received correctly.
Most internet and e-mail providers have special spam filtering servers which block most spam emails or mark your e-mails as unwanted.
New WordPress websites have this issue too, even if you try to use the builtin SMTP it fails often because of the implementation of the local webservers.
Sending emails from your applications (non-web based apps) is also difficult since you need to register to an e-mail address that allows SMTP.
There are e-mail providers out there that help you.
Your own VPS
An easy solution is to register a premium web hosting so that you can increase your hourly e-mail limit. The premium solution is, of course, to buy your own VPS. Hosting your own SMTP server and then add your own SMTP e-mail addresses.
With your own VPS, you will have NO limits and no extra incurring costs when sending e-mails.
The only thing you need to worry about is having a good IP reputation. With Linode's $5 VPS you get one of the best offers in the world for hosting + e-mails.
The only issue with hosting your own SMTP server is that it incurs a lot of administration and initial setup even if you use CPanel, Webmin or Virtualmin.
I've detailed why you shouldn't bother setting up your own mail servers on a VPS in another article.
The current e-mail implementations differ greatly and they're extremely complex to manage and setup.
Is it worth it? Sure, if you're low on cash and want to send around 1 million mails per month the initial setup is worth it.
Due to the fact that e-mail has started getting reliability problems many new companies have spawned to restore the order.
Mandrill is from the company of MailChimp. You pay $20 per each block of 25 000 emails. The price decreases as you send millions of e-mails per month.
The easy part? You get an API to send e-mail from your app or you can send e-mails via SMTP.
Fast and easy integration. No headaches. You can use it from within any app.
What's good about mandrill is that you have statistics about your open rate.
The negative side? It's a little bit too costly.
Sendgrind has an API and SMTP options just like Mandrill.
You can test it for free by sending up to 40.000 mails per month.
There are some specific plans, the essentials one costs $19.95/month for 100 000 e-mails per month. Better pricing than Mandrill. Yet still not the best in the list.
Sendgrind also provides real-time analytics which will help you determine a lot of things.
I only recommend this one for personal/business mail. I use MXRoute for all my domains and I've disabled SMTP/IMAP/POP services on my VPS.
MXRoute is service which provides mail only hosting. It's extremely easy to setup your DNS systems so you can host emails on unlimited domains. This also has the benefits that if your web hosting ever goes down that you can still receive e-mails..
It's far cheaper than Google, Microsoft or any other provider. Since most of those services cost $5 per user per month!
You get access to Cpanel, webmail. You can receive and send e-mails too. It doesn't have all the bells and whistles that Mandrill has but you don't need them.
Since there is no special sending API you need to rely on SMTP for sending.
Amazon Simple Mail Services
The best and cheapest way to send e-mails is, of course, Amazon Simple Mail Services.
Amazon Cloud is expensive for most of its services yet the SES is a great bargain for the fact that you can reliably send e-mails.
If you send e-mail through Amazon's Cloud infrastructure virtual machines you can get to send free e-mails up to a monthly limit.
I use Amazon to send e-mails through other applications when I don't want to send them via MXRoute or if I create an app for someone else.
Their pricing is $0.10 for every 1000 mails you send. Which makes Amazon SES cheaper than Mandrill or Sendgrind. $10 for every 100 000 mails!
The great thing about Amazon SES is that you can also receive e-mails and process them automatically through the cloud.
You also have a $0.12 charge for each GB of attachment you send. If you're smart about it you won't send attachments and place download links instead.
But I came here for sending Marketing e-mails!
Most people want to send marketing e-mails.
I've written some blog posts about Personalized Marketing Experience and Newsletter marketing.
The best solution I've found so far? Using Sendy together with Amazon SES!
E-mail has been around for more than 40 years. It won't disappear pretty soon.
Sending e-mails through a public hosting is not really helping. There are many solutions which vary in price. The best one being your own VPS like Linode which means there is some administration necessary.
A great solution is using MXRoute and setting up DNS if all you need is normal email hosting.
If you need to send thousands of e-mails per day consider going for Amazon SES.
If you need to send newsletter e-mails consider investing in Sendy with Amazon SES.