Here's a suggestion. Use the Mail::Sendmail module for perl.
http://alma.ch/perl/Mail-Sendmail-FAQ.htm
-----Original Message-----
From: KEVIN ZEMBOWER [mailto:[EMAIL PROTECTED]]
Sent: 26 June 2001 14:50
To: [EMAIL PROTECTED]
Subject: Using system to invoke sendmail
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
--------------------------Confidentiality--------------------------.
This E-mail is confidential. It should not be read, copied, disclosed or
used by any person other than the intended recipient. Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful. If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.