#!/usr/bin/perl -w use strict; use Mail::Sender; my $sender = new Mail::Sender { auth => 'PLAIN', authid => 'user', # Change this. authpwd => 'password', # Change this. smtp => 'smtpserver.mydomain.com', # Change this. from => 'user@mydomain.com', # Change this. to => 'foo.bar@yourdomain.com', # Change this. subject => 'test subject', msg => 'This is a text email', file => '/home/foo/bar/default.pdf', debug => "/home/foo/bar/SendMailDebug.txt", debug_level => 4, timeout => 500, }; my $result = $sender->MailFile({ msg => $sender->{msg}, file => $sender->{file}, }); print "$sender->{error_msg}\n>>>End.\n"; 1;