Reputation: 724
I've built an internal company website using Django. I have a view that sends an email to the users of the website using the send_mail() function.
Some users were not receiving emails from the site, and we fount that if they have configured Outlook to High junk-email protection level, the emails from the website are flagged as spam.
Are there any coding techniques for making an email sent from Python appear legitimate to Outlook and other email clients?
Upvotes: 3
Views: 7826
Reputation: 6511
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.
Upvotes: 1
Reputation: 12031
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.
Upvotes: 9