use strict; use MIME::Lite; my $gif = "mime.gif"; my $msg = MIME::Lite->new(From => 'user@hotmail.com', To => 'to@gmail.com', Subject =>'Test the "attach to singlepart" hack', Type => 'TEXT', Data => ["This is a simple text message... ", "can we attach a file to it?\n"]); ### Attach a part: $msg->attach(Type => 'image/gif', Path => $gif); ### Output! $msg->print; $msg->send('smtp','smtp.live.com', Port => 25, AuthUser=>'username, AuthPass=>'upass');