Creating & sending HTML email from a shell script
This is a shell script that sends email containing HTML formatting. It uses a
here-document combined with cat and the - STDIN parameter, which is all piped to
sendmail. It appears mandatory to use the cat and here-document for handling
the message header info. Putting it into $HTML along with the message body
does not work, sendmail reports that it cannot figure out who the message recipient
is. Perhaps it is the semi-colon on the Content-Type line, and the here-document
is the only way to handle it correctly; but that is just a guess.
An html email message from a shell script
This part of the message is just normal text. You can include
whatever HTML markup you like here as well. To send images,
you will have to put the images on an http server and then include
a link to the images.
Didn't know you could do this, did you?!
cat - <
To include images in the email, post the images on a publicly accessible HTTP
server, and then include a link to it in the message.
A prior form of this script read the HTML part from an external file. To use this,
the cat command was slightly different:
cat - /path/to/htmlfile <