background preloader

Email

Facebook Twitter

GuerrillaMail - Disposable Temporary E-Mail Address. Affixa - Attachments Made Easy - Gmail, Yahoo! Mail, Outlook, Th. Random notes from mg. Sending a properly encoded email that contains non-ASCII characters is not as trivial as it should be. Here's more or less what I want: sender = u'Sender \u263A <sender@example.com>'recipient = u'Recipient \u263B <recipient@example.com>'subject = u'Smile!

\u263A'body = u'Smile! \n\u263B'send_email(sender, recipient, subject, body) The hard part is getting all the unicode strings to be properly encoded in the email. Here's the solution: from smtplib import SMTPfrom email.MIMEText import MIMETextfrom email.Header import Headerfrom email.Utils import parseaddr, formataddr def send_email(sender, recipient, subject, body): """Send an email. I wish I could write it like this:

Koolwired.Imap. Antix SMTP Server For Developers. nDumbster - C# .Net Fake SMTP Server. Lamson: Lamson The Python SMTP Server.