open(SENDMAIL, "|/usr/lib/sendmail -t")
 
I believe the author is trying to read the file "sendmail" in /usr/bin ... 

1. but what does the option -t do???
2. Also, the pipe | is also used ... y??

-t tells send mail to process the msg from STDIN, reading To:/From: fields 
from the header.  All you need is a msg like:
To:  "ukhas jean" <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED]
Subject: Hi Jenson

This is the msg body


in  a file (say /tmp/mail.txt) and:
# cat /tmp/mail.txt | /usr/lib/sendmail -t

will mail it.

The pipe at the beginning of the string means perl will  send input to 
that pipe line, as in:
open(SENDMAIL, "|/usr/lib/sendmail -t") 
    or die "can't run /usr/lib/sendmail: $!"

print SENDMAIL "To:  "ukhas jean" <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED]
Subject: Hi Jenson

This is the msg body
";

close SENDMAIL;

a

Andy Bach, Sys. Mangler
Internet: [EMAIL PROTECTED] 
VOICE: (608) 261-5738  FAX 264-5932

"They think they invented NIH."  Colin McCormack on Debian insiders
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to