Search code examples
pythondjangoemailsmtptransactional-email

Do I need to use a Transactional Email Service Provider to send emails with Django?


Context

  1. I would like to send transactional Email with Django.

  2. I understand that there are Transactional Email Service Provider (ESP) that faciliatates this endeavour.

  3. The obvious issue I see with this is the cost associated with it. (I know there ESP with tier plans for small amounts of emails)

Questions

So, I have a few questions regarding this topic:

  • Do I need a Transactional Email Service Provider to send emails through Django?

  • What are the pros and cons of using an ESP for transactional emails in Django?

  • If I decide to do it on my own (without using a ESP), does it scale well?

  • What other issues can you see, that I'm not aware of, and you think they might be relevant?

Final question

  • If my conclusion would be not to use an ESP, what steps should I take to send emails through Django?

I've looked at a Reddit thread where they discuss this topic. But almost everyone keeps recommending using an ESP.


Solution

  • It is not required to use a third party email service. You can configure Django for email with an SMTP server that you install yourself on the server of your choosing, for example Google "smtp server self hosted" to find many products that do this, e.g. sendmail.

    HOWEVER...

    • third party email hosts are much less likely to be marked as "spam"
    • third party email hosts offer free tiers and are relatively inexpensive
    • third party emails have zero maintenance costs
    • if you have email needs that are larger than a single server can handle, you will end up re-inventing the wheel and building some form of a cluster unless you find a self-hosted product that has this feature