Ask HN: How to send emails from a web services without being flagged as spam?

6 points by laurent123456 ↗ HN
I'm developing a web service and will need to send a few emails, for example when a new user registers, to recover passwords, etc. Basically useful emails (not spam).

So I'm wondering what's the best way to ensure they are received by the user? Right now I'm thinking of using OVH SMTP (ssl0.ovh.net) but I'm concerned the emails might end up being blocked. Any suggestion?

7 comments

[ 2.9 ms ] story [ 17.1 ms ] thread
There are any number of email sending providers with API access - Sendgrid, Mailgun, Mailjet, etc. Amazon SES is the most cost effective, but you'd need to do more setup youself vs. one of the API senders.
I'm with this person. Let the professionals do the heavy lifting in terms of email delivery. You just worry about setting things up correctly in terms of DKIM, SPF records etc. The services mentioned all have dashboards to see the amount of spam complaints, so you can keep an eye out on that.

There are also some best practices to keep in mind when sending system emails like this, like not using that same system for marketing emails since they're more likely to get flagged as spam.

Do these services also provide an SMTP address too? As I'd rather not tie the service to a specific API.
They do, although AFAIK they recommend using the API. I recently moved from one to another and it only took switching out the library and a few lines of code, since most of them work very similarly.

Easily worth the added benefits of the API

In short, I believe you can't be sure. Every service I know suffers the problem of black-box, uncontrolled, unknowable spam filters at the destination, which is why web confirmation pages always say something like:

"If the email hasn't arrived within an hour or so, check your spam bin."

It can be mitigated by "doing things properly" but you can never be sure. Make sure your email is contentful and meaningful.

Anecdata: I use sendmail pretty much directly from my shared-hosting service and things very rarely go missing.

They're called transactional emails, I've used mailgun, sendgrid, mandrill, amazon SES. Much of a muchness in deliverability terms.

Setup SPF and DKIM, check it's all correctly setup. Be aware that if you're using SPF and you are sending emails from multiple servers (e.g. business email account like outlook365 and a transactional email service) it has to allow all the servers.