Liam Delahunty: Home Tips Web Contact
Recommended laptop
under £500
.

Think I deserve a present? See my Amazon Wish List

Using Sendmail to send a document as a HTML email

Edit the HTML document adding the following header information.

Errors: errors@servername.com
From: Your Name <your_name@servername.com>
To: Recipient Name <recipient@servername.com>
Subject: Message Subject
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Base: http://www.servername.com

Now send the document like so:

cat filename | sendmail -oi -t

The -t means read recipients from file, the -oi means "Ignore dots alone on lines by themselves in incoming messages. This should be set if you are reading data from a file.

Share this!