$msg = MIME::Lite->new(
To =>'you@yourhost.com',
Subject =>'HTML with in-line images!',
Type =>'multipart/related'
);
$msg->attach(
Type => 'text/html',
Data => qq{
<body>
Here's <i>my</i> image:
<img src="cid:myimage.gif">
</body>
},
);
$msg->attach(
Type => 'image/gif',
Id => 'myimage.gif',
Path => '/path/to/somefile.gif',
);
$msg->send();
But replacing $msg->send(); with $smtp->datasend($msg->as_string).
In practice it might be more complicated since you will have to check for lines with a single period (untested):
$smtp->datasend(
join "\n",
map { $_ eq "." ? ".." : $_ }
split "\n",
$msg->as_string
);
|