A Good Mailer

Victor Subervi victorsubervi at gmail.com
Thu Nov 19 09:51:33 EST 2009


On Wed, Nov 18, 2009 at 6:30 PM, Nick Stinemates <nick at stinemates.org>wrote:

> On Wed, Nov 18, 2009 at 03:27:11PM -0400, Victor Subervi wrote:
> > Hi;
> > I need a good mailer that will enable me to mail email from web forms.
>
> smtplib
>
> > Suggestions?
>
> silly example..
>
> #!/usr/bin/env python
> import smtplib
>
> session = smtplib.SMTP("localhost")
> username = "abc"
> password = "def"
> session.login(username, password) # only if it requires auth
>
> subject = "Hello, "
>
> header = "Subject: %s \r\nContent-type: text/html;
> charset=utf-8\r\n\r\n"
>
> message = "world!"
>
> email_from = "victor at is.awesome"
> email_to = ["email at myhost.com"]
>
> session.sendmail(email_from, email_to, header+messages)
>
> HTH,
>

Helps a lot! Thanks!
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091119/8496385d/attachment.html>


More information about the Python-list mailing list