Send HTML formatted mail from Unix using Sendmail

Contributor Icon Contributed by braindonor  
Tag Icon Tagged: UNIX  

I have used this quite a bit and it works great for me. We’re on an HP box running Unix 11.11. You can embed javascripts, css, etc. Pretty cool stuff.


(
echo "From: you@your_company.com"
echo "To: you@your_company.com"
echo "MIME-Version: 1.0"
echo "Content-Type: multipart/mixed;"
echo ' boundary="PAA08673.1018277622/server.domain.com"'
echo "Subject: Test Message"
echo ""
echo "This is a MIME-encapsulated message"
echo ""
echo "--PAA08673.1018277622/server.domain.com"
echo "Content-Type: text/html"
echo ""
echo "

Test Message Body


"
echo "--PAA08673.1018277622/server.domain.com"
) | sendmail -t

 

4 Comments -


  1. cool said on June 5, 2009

    HTML emails are cool!

  2. Anonymous said on August 18, 2010

    The last boundary should have a — at the end, i.e.:
    –PAA08673.1018277622/server.domain.com–

  3. Shantanu Borate said on January 19, 2011

    Hi,
    I am getting “No recipient addresses found in header” even though I have mentioned email id. Please let me know how do I fix it.

    Thanks.

  4. abc said on July 13, 2011

    can we use button in html email and can we use javascript for action of that button

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -