Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??
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. . .


In reply to Re: Runs with perl -d, but ... by notsoevil
in thread Runs with perl -d, but ... by notsoevil

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.