use MIME::Lite;
my $to = 'anthony@currentmarketing.com';
my $fax = '/tmp/1049811816.pdf';
# Start with a simple text message:
my $msg = MIME::Lite->new(
From =>'anthony@domain.com',
To =>$to,
Subject =>'FAX for you.',
Type =>'TEXT',
Data =>"Here is a fax for you!\n\n:)"
);
print "created msg\n";
# Attach a part ... the make the message a multipart automatically:
$msg->attach(Type =>'application/pdf',
Path =>$fax,
Filename =>'fax.pdf',
);
print "attached pdf\n";
# Now send?
$msg->send_by_smtp('216.26.151.48');
print "sent by smtp worked\n";
print "Sent $fax to $to\n";
####
[notsoevil@dragon anthony]# ./convert2.pl
created msg
attached pdf
####
[notsoevil@dragon anthony]# perl -d convert2.pl
Default die handler restored.
Loading DB routines from perl5db.pl version 1.07
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(convert2.pl:61): &sendmail();
DB<1> n
created msg
attached pdf
sent by smtp worked
Sent /tmp/1049811816.pdf to anthony@currentmarketing.com
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
DB<1> q