On Fri, 17 Oct 2003, Diane Prange wrote:

> anyone know of a way to script mailing an e-mail specifying -r, who it
> is from, -s, the subject, -c copy to, and -b blind copy.  Or does anyone
> know of source for BSD mailx which will run on RedHat 9.0?

        You should better modify a little bit that sequence of code that 
sends e-mails.

        Now, prolly your code now looks something like this:

== cut ==
die $! if (!(open(MAILPIPE,\
        "| /bin/mail -r 'Your Name Here <[EMAIL PROTECTED]>'\
                -c 'The Other Guy From elsewhere <[EMAIL PROTECTED]>' \
                -b 'I don\'t know who <[EMAIL PROTECTED]>'
                -s 'You have new mail!'\
                That Guy from Tech Supp <[EMAIL PROTECTED]>")));
while ($line=<read text from some file or array>) {
        print MAILPIPE $line;
}
close(MAILPIPE);
== EO cut ==

        You should modify it an use sendmail -t instead of mail. Anyway 
you have sendmail installed on that host to do local mail delivery. Your 
code should look like this:

== cut ==
die $! if (!(open(MAILPIPE, "| /usr/sbin/sendmail -t")));

print MAILPIPE <<"END";
From: Your Name Here <[EMAIL PROTECTED]>
To: That Guy from Tech Supp <[EMAIL PROTECTED]>
Cc: The Other Guy From elsewhere <[EMAIL PROTECTED]>
Bcc: I don't know who <[EMAIL PROTECTED]>
Subject: You have new mail!
END

while ($line=<read text from some file or array>) {
        print MAILPIPE $line;
}
close(MAILPIPE);
== EO cut ==

        This should run anywhere in this form, not just on SunOS, *BSD
or Linux.

-- 
Tarhon-Onu Victor
Area Technical Coordinator
RDS Iasi - Network Operations Center
www.rdsnet.ro, www.rdstel.ro, www.rdslink.ro
Phone: +40-232-218385; Fax: +40-232-260099
..........................................................................
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver this
message to anyone. In such a case, you should destroy this message and
kindly notify the sender by reply e-mail.


_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to