Okay, code is now:
sub sendmail() {
# my $to = shift;
# my $fax = shift;
my $to = 'anthony@currentmarketing.com';
my $fax = '/tmp/1049811816.pdf';
### Create the multipart "container":
my $msg = MIME::Lite->new(
From => 'anthony@currentmarketing.com',
To => $to,
Subject => 'FAX for you.',
Type => 'multipart/mixed'
);
print "created msg\n";
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(
Type =>'TEXT',
Data =>"Here is a fax for you!\n\n:)"
);
print "added text part\n";
### Add the pdf part:
$msg->attach(Type =>'application/pdf',
Path => $fax,
Filename => 'fax.pdf',
Disposition => 'attachment'
);
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";
}
But guess what? It still doesn't work, unless run via the debugger.
RMGir, thanks for the advice though.
Anyone else have an idea?
Here is the output when it hangs (with new prints in there):
[anthony]# ./convert2.pl
created msg
added text part
attached pdf
--
notsoevil
--
Jeremiah 49:32 - And their camels shall be a booty. . .