Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send HTML mail from command line

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Can anybody tell me how to send mail formatted as html via command line (i.e. sendmail or mailx) ?

I have tried
cat file.html | mailx -s "subject" recipient@mail.com

but that ends up as plain text with html tags.

All help appreciated!
-Brian
 
IIRC, you have to add some extra headers. Depending on how you want it to come out, you may be able to add:

Code:
content-type: text/html

But I'm not entirely sure if you can pass headers like that to sendmail. If you had procmail installed, you could use the formail program to add headers, I think the switch is something like:

Code:
formail -A "headername: value"

Hope that gives you an idea on where to start :) --
Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top