Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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.


  • 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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-10-28 21:01 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (96 votes). Check out past polls.