I want to send an HTML email.
have a plain text file that looks like this:
From: "name" <[email protected]>
To: [email protected]
Subject: First Email
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Disposition: inline
<strong>Hello, World!</strong>
I run mailx
like this,
mailx -t -S smtp=server.com [email protected] < file
It sends a plain-text email instead and prints:
Ignoring header field "MIME-Version: 1.0"
Ignoring header field "Content-Type: text/html; charset=us-ascii"
Ignoring header field "Content-Disposition: inline"
Why?
How do I send an html email?
Other sources say to use the -a
flag and specify the content-type,
but -a
on my version of mailx
is attachment; so that doesn't work.
When using option -t
, mailx filters out header fields and only keeps the following ones:
to:
cc:
bcc:
from:
reply-to:
sender:
organization:
Any other header produces the "Ignoring header field" warning message and is discarded.
This is effectively cryptic in the manual.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With