Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Runs with perl -d, but ...

by notsoevil (Pilgrim)
on Apr 09, 2003 at 14:49 UTC ( #249230=note: print w/replies, xml ) Need Help??

in reply to Runs with perl -d, but ...

Okay, code is now:
sub sendmail() { # my $to = shift; # my $fax = shift; my $to = ''; my $fax = '/tmp/1049811816.pdf'; ### Create the multipart "container": my $msg = MIME::Lite->new( From => '', 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(''); 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]# ./ created msg added text part attached pdf

Jeremiah 49:32 - And their camels shall be a booty. . .

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://249230]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2023-12-08 20:08 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (37 votes). Check out past polls.