Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Update</strong>: Someone wrote an article on configuring mutt for using with a python script. I have myself never done it. <a href="http://pthree.org/2011/03/24/hashcash-and-mutt/" rel="nofollow">hashcash and mutt</a>, the article goes through the configuration of muttrc and give code example.</p> <hr> <p><strong>Old answer</strong></p> <p>Does it solve your issue?</p> <pre><code>#!/usr/bin/env python from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart # create the message msg = MIMEMultipart('alternative') msg['Subject'] = "My subject" msg['From'] = "foo@example.org" msg['To'] = "bar@example.net" # Text of the message html = """&lt;html&gt; &lt;body&gt; This is &lt;i&gt;HTML&lt;/i&gt; &lt;/body&gt; &lt;/html&gt; """ text="This is HTML" # Create the two parts plain = MIMEText(text, 'plain') html = MIMEText(html, 'html') # Let's add them msg.attach(plain) msg.attach(html) print msg.as_string() </code></pre> <p>We save and test the program.</p> <pre><code>python test-email.py </code></pre> <p>Which gives:</p> <pre><code>Content-Type: multipart/alternative; boundary="===============1440898741276032793==" MIME-Version: 1.0 Subject: My subject From: foo@example.org To: bar@example.net --===============1440898741276032793== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit This is HTML --===============1440898741276032793== Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit &lt;html&gt; &lt;body&gt; This is &lt;i&gt;HTML&lt;/i&gt; &lt;/body&gt; &lt;/html&gt; --===============1440898741276032793==-- </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload