How to mail a html file.?

Hi,

Can anyone tell me how to mail a html file in unix?

I have a HTML file which contains a table structure, and i want this table to be created in the mail body and mail it.

Does anyone have any suggestions.

echo "Content-type: text/html" > mail.html
echo "FROM: Rocky<you@gmail.com>" >> mail.html
echo "TO: recepient@gmail.com" >> mail.html
echo "SUBJECT: Test mail" >> mail.html
cat file.html >>mail.html

cat mail.html | sendmail -t

MIME (Multimedia Internet Mail Extensions) allows you specify the content type of your mail.
in the headers of your mail (ie before the first new line) you could specify

Content-type: text/html;

This will tell the mail client to render the contents as html.

use this

 
CONTENT=<HTML File name>
export SUBJECT="Subject Line `date` ]"
(
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat $CONTENT
) | /usr/sbin/sendmail $MAIL_LIST

You can use this..:slight_smile: just make sure that sendmail is working