my $body = 'This is a body of your message!'; # Define a hash with mail data my $data_href = { to => 'recipients mails', body => \$body, ctype => 'text/plain', smtp => 'your smtp server', from => 'your email addr', replyto => 'reply to addr', subject => 'Your subject', }; my $sender = new Mail::Sender() or die "Cannot create sender object!"; $sender->OpenMultipart( { %$data_href, encoding => "quoted-printable", debug => '/your/place/for/log file', } ); warn "Error in mailing : $Mail::Sender::Error\n" unless ref $sender; $sender->Body( { msg => ${$data_href->{body}}, ctype => $data_href->{ctype}, encoding=> 'Base64', } ); $sender->Attach( { file => 'your attach file', description => 'Your attach description', ctype => 'your attach file mime type', encoding => 'Base64', disposition => "attachment; file='your attach file'; type='PDF'", } ); $sender->Close; if(defined $sender->{error}) { warn "Error of sending mail to '$$data_href{to}': ".$sender->{error}."!!!" } else { warn "Mail was sent to the '$$data_href{to}'!" }