{ "info": { "author": "Ingeniweb", "author_email": "support@ingeniweb.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "================\niw.email package\n================\n\n.. contents::\n\nWhat is iw.email ?\n******************\n\nProvide a clean way to generate emails.\n\nHow to use iw.email ?\n*********************\n\nThere is multiple way to use iw.email. See bellow.\n\n\n\nMultipartMail\n=============\n\nThe base class of the package is the MultipartMail. You can use it to easily\ngenerate email both in html or text format with a correct encoding.\n\nWe need some html for email body::\n\n >>> umail = unicode('''
\n ... corps du maiil avec caract\u00e8re unicode:\n ... utf-8: \u00e9 \u00e0 \u00ee \u00f6 \n ... cp552: \\xe2\\x80\\x93 \\xe2\\x80\\x99\n ... ''', 'utf-8')\n\n\nAnd a smtp server::\n\n >>> from smtplib import SMTP\n >>> server = SMTP('localhost')\n\nNow we can use the MultipartMail class to generate an email::\n\n >>> from iw.email import MultipartMail\n\n >>> mail = MultipartMail(html=umail,\n ... mfrom='sender@ingeniweb.com',\n ... mto='recipient@ingeniweb.com',\n ... subject=unicode('suj\u00e8\u00e9\u00e8t','utf-8'))\n\nAnd send it::\n\n >>> server.sendmail('sender@ingeniweb.com','recipient@ingeniweb.com', str(mail))\n Content-Type: multipart/related; charset=\"iso-8859-1\";\n ...\n MIME-Version: 1.0\n To: recipient@ingeniweb.com\n From: sender@ingeniweb.com\n Subject: =?iso-8859-1?q?suj=E8=E9=E8t?=\n ...\n Content-Type: multipart/mixed; charset=\"iso-8859-1\";\n ...\n Content-Type: text/html; charset=\"iso-8859-1\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: quoted-printable\ncorps du maiil avec caract=E8re unicode:\n iso-8859-1: =E9 =E0 =EE =F6\n cp552: - '
\n