in reply to Re: 'Best way to email edited array contents?
in thread 'Best way to email edited array contents?

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

Replies are listed 'Best First'.
Re: Re: Re: 'Best way to email edited array contents?
by Anonymous Monk on Feb 12, 2004 at 20:30 UTC
    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?