[Django]-Prevent emails from Python from being flagged as spam

9đź‘Ť

This is not really Django related problem but more about what and how you send emails, there are lots of great articles and blog posts about this topic, this is one of my favorite:

http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html

Of course you can always take a different direction and let someone else do the job for you, this will work almost certainly better that running your own smtp server. You are going to have nice stuff like stats (things like bounces, hard bounces, spam, blocks…) higher deliverabilty …

This come with a price which in my experience will be less than the time your are going to spend to let the things run properly 🙂

Just to name one of those I had direct experience using MailJet with Django to handle quite big email sending (few millions per week) and it works great.

1đź‘Ť

What worked for me was a simple thing that was missing. I added a “text_content” argument
(2nd from left) which was left blank before.

Also I added some text in the template in paragraph form .

    msg = EmailMultiAlternatives(
                  subject, "Please find details of Candidate in this mail", 
                  request.user.email, 
                  [round_taker.email])

I know this sounds NOT so technical. But it might work for some people.

Leave a comment