Reputation: 37834
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.
Upvotes: 8
Views: 2014
Reputation: 135
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.
Upvotes: 1