#!/usr/bin/perl -w # Send HTML document with inline images use strict; use MIME::Lite; # Create a new MIME Lite object my $msg = MIME::Lite->new( From =>'foo@foo123.com', To =>'whoever@wherever.com', Subject =>'Hi', Type =>'multipart/related'); # Add the body to your HTML message $msg->attach(Type => 'text/html', Data => qq{

Hi

This is an HTML message.

Here's a link.

}); # Attach the image $msg->attach(Type => 'image/jpg', Id => '2uni2.jpg', Path => '2uni2.jpg'); # Send it $msg->send();