Re: mailx -r option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <fromme@domain>'\
		-c 'The Other Guy From elsewhere <ccto@domain>' \
		-b 'I don\'t know who <bbcto@domain>'
		-s 'You have new mail!'\
		That Guy from Tech Supp <tosomeone@domain>")));
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 <fromme@domain>
To: That Guy from Tech Supp <tosomeone@domain>
Cc: The Other Guy From elsewhere <ccto@domain>
Bcc: I don't know who <bbcto@domain>
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
Redhat-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux