#!/usr/bin/perl -w #----------------------------------------------------------------------------- # All this does is generate RFC 822 headers and then copy standard input # to standard output. You determine what headers it generates with # command options. # # You can feed the output of this program to 'smtpsend' to send the mail # message somewhere via SMTP. #----------------------------------------------------------------------------- use strict; my $TRUE=1; my $FALSE = 0; use Getopt::Long; my %options; GetOptions(\%options, "from=s", "to=s", "cc=s", "subject=s", "date=s", "reply_to=s" ); if (defined($options{"subject"})) { print("Subject: " . $options{"subject"} . "\n"); } if (defined($options{"to"})) { print("To: " . $options{"to"} . "\n"); } if (defined($options{"cc"})) { print("Cc: " . $options{"cc"} . "\n"); } if (defined($options{"from"})) { print("From: " . $options{"from"} . "\n"); } if (defined($options{"date"})) { print("Date: " . $options{"date"} . "\n"); } if (defined($options{"reply_to"})) { print("In-Reply-To: <" . $options{"reply_to"} . ">\n"); } print("\n"); while () { print; }