vincer has asked for the wisdom of the Perl Monks concerning the following question:

Hi I have searched the code discussion group on a way to e-mail from my script. I have found lots of cool stuff. However, the only mail command the seems to be supported by my web host is the unix mail command (no mail perl modules)

So this is what I have put together but it dosn't work

$add = "name\@isp.com\n"; $msg = "some message\n"; $end = "\cD"; system "mail $add $msg $end"; print "ok the msg was sent";
Thanks Vincer

20030325 Edit by Corion: Added formatting

Replies are listed 'Best First'.
Re: mail from script help
by davorg (Chancellor) on Mar 25, 2003 at 12:24 UTC
Re: mail from script help
by zby (Vicar) on Mar 25, 2003 at 12:21 UTC
    This way you execute the mail command with three parameters - I can't say why it does not work - since I don't know what parameters the mail command takes, but the last one is a bit strange. Perhaps you wanted to simulate input to the mail program, but to do that you need to have a pipe to it - how to do it you can find in perldoc -f open.