Why not use a module Mail::Sendmail
grab the output relatively into an array
configure the mail parameters and send the output array as the mailbody.
looks fine.
if the output is needed as an attachment , use the system command uuencode with mailx that should do.
Wiggins d'Anconia wrote:
Moon, John wrote:

Moon, John wrote:
[snip]


Here something that I do routinely...

<snip>
open MAILMAN, "| rmail $To_Address";
print MAILMAN "Subject: Some subject\n";
print MAILMAN "From: $Reply_to\n\n";
print MAILMAN "some message.....";
close MAILMAN;
</snip>


And routinely it is a bad idea...please don't encourage its use here. Mail should be handled delicately, by a module designed to do it properly.


http://danconia.org

FMI... What the difference in:

open EXTRACT, "|sort > /tmp/Tmp$$";

And

open MAILMAN, "|rmail $to_someone";


jwm



Nothing. Don't encourage either, I certainly haven't. They are both insecure, error prone, non-portable, slow, and generally poorly written.


I'm not saying you can't do it, or that it won't work, just please don't encourage it in a forum where beginners are (hopefully) trying to learn good habits and methods.

So if I want my output as an attachment, does your example work? How much code do you think it would take to get it to work? Do you know all of the intricacies of the message protocol to do it without looking at an RFC?

What if I am running in a chroot'd environment?

http://danconia.org

-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to