tags:

views:

20

answers:

2

How can i send the email using mailx command including the HTML code? for example:

mailx -s "Report" << EOF
Report Generated
<table width="600">
<tr><td width="30%">&nbsp;&nbsp;</td><td width="35%" style="font-size:7pt;">Definition</td></tr></table>EOF

however the mail did send, but which is not as html code..

Anybody know how to send mailx including the html inside the mail body?

A: 

I havent used mailx for sending HTML but have used sendmail. You can use the following if you can use sendmail instead of mailx (echo -e "Subject: $SUBJECT\nMIME-Version: 1.0\nFrom: $MAIL_FROM\nTo:$MAIL_TO\nContent-Type: text/html\nContent-Disposition: inline\n\n";/bin/cat $MAIL_FILE) | /usr/sbin/sendmail -f $MAIL_FROM $MAIL_TO

I tried this on Linux

Raghuram
A: 

Put

Content-Type: text/html

followed by empty line before message body.

Paweł