Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Passing variables to function's hash.

by FrankRizzo (Acolyte)
on Jan 18, 2005 at 22:52 UTC ( [id://423212]=note: print w/replies, xml ) Need Help??


in reply to Re: Passing variables to function's hash.
in thread Passing variables to function's hash.

Sorry about that guys, thought it might be a generic enough question to not NEED a code sample.
my $from_name = $mail_from; my $from_address = $display_name; my $to_address = $_; my $subject = 'Daily Report'; my $mime_type = 'TEXT'; my $message = "Your PDF report is attached."; # Create the initial text of the message my $mime_msg = MIME::Lite->new( From => $from_address, To => $to_address, Subject => $subject, Type => $mime_type, Data => $message ) or die "Error creating MIME body: $!\n"; my $filename = 'daily.pdf'; my $recommended_filename = 'daily.pdf'; # Attach the file $mime_msg->attach( Type => 'application/pdf', Path => $filename, Filename => $recommended_filename ) or die "Error attaching test file: $!\n";
As you can tell from the code, most, if not ALL the of important info comes from variables, most of which come from a config file, or are retrieved from a database.

Replies are listed 'Best First'.
Re^3: Passing variables to function's hash.
by Tanktalus (Canon) on Jan 19, 2005 at 00:17 UTC

    I installed MIME::Lite, took your code above, put in the missing "use MIME::Lite;" at the top, and ran it with perl 5.8.5. No compilation errors, no die's were triggered. Is this the exact piece of code that, by itself, is triggering the problem you're having?

    Thanks,

      *sigh* Have you ever had it happen? You ask a question, and in the process of reading the responses the answer comes to you? Well, it happened to me. I pasted that code, and while reading the comments figured out that I was doing stupid things in my attempts to set up the fields. (And, in the process, pasted the WRONG code. I have 4 or 5 modules here, all with different e-mail libs, all failing for some different reason, and I picked the wrong one. But, thanks anyway guys! As it turned out, you helped more than you know! Frank

        For posterity's sake ... and for anyone using the supersearch function here ... mind going into a bit more details about what was wrong? :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-26 05:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found