0

--- Edit ---

This was due to a setting in sendgrid who we use to relay our email, not mutt.


I have a report that I will run daily and want to email the results using mutt. I put the report in a text file, then use

mutt me@myaddress.co.uk -s "My report" < emailbody.txt

The resulting email contains a section with

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

 - staging_tts_db - Schema Change found

--------------------------------------------------------------------------------

4301c4301
< ) ENGINE=MyISAM AUTO_INCREMENT=918489 DEFAULT CHARSET=latin1;
---
> ) ENGINE=MyISAM AUTO_INCREMENT=918488 DEFAULT CHARSET=latin1;

and the message is plain text and correctly formatted, followed by a section with

Content-Type: text/html; charset="us-ascii"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

<html><body>
<pre>- staging_tts_db - Schema Change found</pre>
<p>------------------------------------------------------------------------=
--------</p>
<h3>4301c4301 &lt; ) ENGINE=3DMyISAM AUTO_INCREMENT=3D918489 DEFAULT CHARSE=
T=3Dlatin1;</h3>
<blockquote><p>) ENGINE=3DMyISAM AUTO_INCREMENT=3D918488 DEFAULT CHARSET=3D=
latin1;</p></blockquote>

and the formatting is all over the place. My email glient (gmail) is picking up the html version to display

I want to only generate the plain text version of the email. I have tried passing a header as part of the email body, but that's just added as text within the message.

I had it working correctly using sendmail, but as I want to include an attachment, I've switched to using mutt.

I'm using mutt 1.5.21 on Debian wheezy

3
  • What does you .muttrc file look like? – Kusalananda Jan 28 '19 at 9:12
  • I haven't got a user-specific .muttrc. Everything else is out-of-the box – Kevin Jones Jan 28 '19 at 9:19
  • 1
    AFAIK, mutt does not implement a facility to automatically convert plan text messages into HTML. – Kusalananda Jan 28 '19 at 10:05
1

We use postfix and sendgrid to deliver the emails from our systems.

sendmail was sending the email directly (not via postfix/sendgrid), so wasn't adding the html part of the email.

Sendgrid has a setting (on by default) that adds a html version of the email as well.

mutt was sending emails via postfix/sendgrid and was getting the html added. After changing the setting (Settings ... Plain Content ... Convert your plain text emails to HTML ... Turn on if you don't want to convert your plain text email to HTML) it is working as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.