title: Why Python's standard library has a weak support for sending email
body: <p>Python is advertised as a "batteries included" language.
  So, I wonder why it's standard library doesn't include high level support for emails:</p>
  
  <p>I found that you need to know lot about MIME to create an email message equivalent to what you can achieve in a typical email client, such as handling HTML content, embedded images and file attachments.</p>
  
  <p>To achieve that you are required to do a <a href="https://stackoverflow.com/questions/920910/python-sending-multipart-html-emails-which-contain-embedded-images">low level assembly of the message</a>, such as:</p>
  
  <ul>
  <li>handle <code>MIMEMultipart</code> sections, and know about <code>related</code>, <code>alternate</code>, etc.</li>
  <li>know about file encodings, such as <code>base64</code></li>
  </ul>
  
  <p>If you're just learning about MIME enough to assemble such an email, It's easy to fall into traps, such as bad section nesting, and create messages that may not be correctly viewed by some email clients.</p>
  
  <p>I shouldn't need to know about MIME to be able to correctly send an e-mail. 
  A high level library support should <a href="http://code.activestate.com/recipes/473810/" rel="nofollow noreferrer">encapsulate all this MIME logic</a>, allowing you to write something like this:</p>
  
  <pre><code>m = Email("mailserver.mydomain.com")
  m.setFrom("Test User &lt;test@mydomain.com&gt;")
  m.addRecipient("you@yourdomain.com")
  m.setSubject("Hello there!")
  m.setHtmlBody("The following should be &lt;b&gt;bold&lt;/b&gt;")
  m.addAttachment("/home/user/image.png")
  m.send()
  </code></pre>
  
  <p>A non standard library solution is <a href="http://www.magiksys.net/pyzmail/" rel="nofollow noreferrer"><code>pyzmail</code></a>:</p>
  
  <pre><code>import pyzmail
  sender=(u'Me', 'me@foo.com')
  recipients=[(u'Him', 'him@bar.com'), 'just@me.com']
  subject=u'the subject'
  text_content=u'Bonjour aux Fran\xe7ais'
  prefered_encoding='iso-8859-1'
  text_encoding='iso-8859-1'
  pyzmail.compose_mail(
          sender,  recipients, 
          subject, prefered_encoding,  (text_content, text_encoding), 
          html=None, 
          attachments=[('attached content', 'text', 'plain', 'text.txt',
                        'us-ascii')])
  </code></pre>
  
  <p>Is there any reason for this not being in the "batteries included" standard library?</p>