Where is the phpMailer php class equivalent for Python?
|
1
|
Hi guys, i'm new with python.. Actually, i'm trying to send featured email with python: html body, text alternative body, and attachment. So, i've found this tutorial and adapted it with the gmail authentication (tutorial found here) The code i have atm, is that:
and that works.. now only miss the attachment.. And i am not able to add the attachment (from this post) So, why there is not a python class like phpMailer for php? Is it because, for a medium-able python programmer sending a html email with attachment and alt text body is so easy that a class is not needed? Or is because i just didn't find it? If i'll be able to wrote a class like that, when i'll be enough good with python, would that be useful for someone? |
|||
|
|
If you can excuse some blatant self promotion, I wrote a mailer module that makes sending email with Python fairly simple. No dependencies other than the Python smtplib and email libraries. Here's a simple example for sending an email with an attachment:
Edit: Here's an example of sending an HTML email with alternate text. :)
Edit 2: Thanks to one of the comments, I've added a new version of mailer to pypi that lets you specify the port in the Mailer class.
|
||||||||||||||||
|
|
|
Django includes the class you need in core, docs here
In my settings I have:
|
||
|
Fom Stackoverflow.com







