#!/usr/bin/perl ########################################### # mailas -- Send mail as someone # Mike Schilli, 2002 (m@perlmeister.com) ########################################### use warnings; use strict; use Mail::Mailer; use Getopt::Std; use Pod::Usage; our $CVSVERSION = '$Revision: 1.4 $'; getopts( 's', \ my %opts ); $opts{s} = "No subject" unless $opts{s}; my ($to, $from) = @ARGV; pod2usage() unless $from; my $message; while((my $line = ) ne ".\n") { $message .= $line; } my $mailer = Mail::Mailer->new("sendmail"); $mailer->open({ From => $from, 'Reply-To' => $from, To => $to, Subject => $opts{s}, } ); print $mailer $message; $mailer->close; __END__ =head1 NAME mailas - Send mail as someone =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS mailas to_email from_email [-s subject] =head1 DESCRIPTION C is a regular mailer which allows you to set the 'From:' field, e.g. to subscribe to a mailing list under a special name to allow filtering in your incoming mail box. After invokation, C will take message lines until you type in one containting only a single dot (.). =head1 EXAMPLES $ mailas scott@sun.com gates@microsoft.com Hey Scott, are you up for golf this afternoon? -- Bill . =head1 LEGALESE Copyright 2002 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR 2002, Mike Schilli