Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: 'Best way to email edited array contents?

by jlongino (Parson)
on Feb 12, 2004 at 06:04 UTC ( #328485=note: print w/ replies, xml ) Need Help??


in reply to 'Best way to email edited array contents?

I may be overlooking something obvious here, but it looks to me like you never include any attachment/body to %mail. You include to, from, subject and smtp but nothing else.

--Jim


Comment on Re: 'Best way to email edited array contents?
Replies are listed 'Best First'.
Re: Re: 'Best way to email edited array contents?
by Anonymous Monk on Feb 12, 2004 at 19:27 UTC
    Hi Jim.
    Perhaps this is the problem. I tried using the recipe from Oreilly's Perl Cookbook, but still get the same results--an empty email:
    $mailer = Mail::Mailer->new("sendmail"); $mailer->open({ From => $fromaddress, To => $toaddress, Subject => $subject, }) or die "Can't open: $!\n"; print $mailer $body; $mailer->close();

    I apologize in advance for my ignorance, but I am not sure where to put the "print $mailer $body;" and the "$mailer->close();" lines.

    From what I read, I thought I was to put the "$mailer->close();" line at the end of the script, but I'm not sure where to put the "$body" line. I think my problem is most likely not getting a handle on my object.
    Thanks for your help/responses. -Chris

      I guess all I needed was a sprintf command joining the $body with each additional user for which quota data was collected:
      $body = $body . sprintf ("$user\'s disk usage \= %.2f MB.\nHas %.2f MB + available.\nQuota se t to: %.2f MB\n\n", $used, $remainingquota, $limit);</BOLD>

      Now I get the emailed quota data.
      Thanks for the reponses, Chris
        I guess what you say is true, but how could it work before upgrading?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2015-07-29 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls