Need syntax for mailing in UNIX by using html file as body and along with attachment

Hi All,

I need a syntax for mailing in unix by using html code file output as body and along with attachment (without using mutt command)

HTML code file : html1.txt
Attachment : attach1.txt

I was using the below codes but they are not working.

( cat html1.txt ; uuencode attach1.txt attach1.txt )| mail -s "My Subject echo -e "Content-type:text/html"" abc@def.com 

-- Here attachment also coming as special characters in body without any attachment file

( cat html1.txt ; uuencode attach1.txt attach1.txt )| mail -s "My Subject" abc@def.com

-- Here in body html code is displayed but i need html output

uuencode attach1.txt attach1.txt | mail -s "My Subject" abc@def.com < html1.txt

Please suggest.

In the past I have used uuencode and mpack to add attachments to send email through shell scripts. I found uuencode did not work with UTF8. Hence I switched to MIME::Lite.

MIME::Lite - search.cpan.org

MIME::Lite has not been maintained or updated in awhile, but it should work. There are sample scripts out on the net.

Have you considered the posts already on the forums ?

When i scroll all the way down on this post, i see a lot of solutions in various programming languages and mail clients.

This one sure looks promising :

Thanks gandolf989 and
Peasant . None of the queries in the link are working

In what way are they not working? What have you tried?