require "Lite.pm"; $msg = MIME::Lite->new( To =>$sendtoemail, From =>$useremail, Cc =>$useremail, Subject =>'You got a webcard!', Type =>'multipart/related' ); push (@attachments, [ Type => 'image/gif', Id => 'mygreeting', Path => "$real_imagepath/$greeting", ]); if ($no_thumb eq "ON") { $mtext .= < Here's my image:
EOX push (@attachments, [ Type => 'image/gif', Id => 'mythumb', Path => "$real_imagepath/$thumb", ]); } if ($no_image eq "ON") { $mtext .= < Here's my image of you:
EOX push (@attachments, [ Type => 'image/jpg', Id => 'myimage2', Path => "$real_imagepath/$image", # filename => "$image", # Disposition => 'attachment' ]); } if ($no_photo eq "ON") { $mtext .= < Here's my image of you:
EOX push (@attachments, [ Type => 'image/jpg', Id => 'photo', Path => "$real_imagepath/$photo", # filename => "$photo", # Disposition => 'attachment' ]); } $msg->attach(Type => 'text/html', Data => "\n" . $mtext . "\n"); foreach $attachment (@attachments) { $msg->attach(@$attachment); } $str = $msg->as_string; $msg->print(\*SENDMAIL); $msg->send ('sendmail', '/usr/lib/sendmail -t');