Embedding images in HTML email for Outlook

#!/bin/sh
echo "Content-Type: multipart/related; boundary=\"boundary-example\"; type=\"text/html\""
echo
echo "--boundary-example"
echo "Content-Type: text/html"
echo
echo "<h1>Email</h1>"
echo "<img src=\"cid:image.png\" alt=\"image\">"
echo
echo "--boundary-example"
echo "Content-Location: CID:something"
echo "Content-ID: <image.png>"
echo "Content-Type: image/png"
echo "Content-Transfer-Encoding: BASE64"
echo
base64 /tmp/image.png
echo "--boundary-example--"
./email.sh | sendmail some@emailaddress.com
Share on facebook
Share on twitter
Share on linkedin
Share on print
Share on email