I need some help using the perl command "system" to invoke sendmail. I'm trying to
send an
email message to a mailing list. I got what I'm trying to do from a shell script:
/usr/sbin/sendmail [EMAIL PROTECTED] <<HERE
To: [EMAIL PROTECTED]
X-Command: $maintainer $password $command
Subject: X-Processed: $command of <[EMAIL PROTECTED] >
HERE
I'm trying to duplicate what this section of the shell script does in perl.
I've tried this, but it doesn't work:
print ("sendmail error is ", system ('/usr/sbin/sendmail kzembower\@jhuccp.org \
To: kzembower\@jhuccp.org\n\
X-Command: test\n\
Subject: X-Processed: test\n\
\n\
\n\
.'));
Any suggestions or thoughts to get me started? Also, if I want to print or act on the
exit
code of sendmail, how would I do that?
Thanks for all your help and suggestions.
-Kevin Zembower
-----
E. Kevin Zembower
Unix Administrator
Johns Hopkins University/Center for Communications Programs
111 Market Place, Suite 310
Baltimore, MD 21202
410-659-6139