subject
message
to
####
package PL::Mail;
use strict;
use Mail::Sendmail;
my $server = 'pop.dnvr.qwest.net';
my %mail;
sub new {
my $class = shift;
my $self = {};
$mail{Smtp} = $server;
$mail{From} = 'Postmaster ';
$mail{To} = $self->{TO} ? $self->{TO} : 'Devin Austin ';
$mail{Subject} = $self->{SUBJECT};
$mail{Message} = $self->{MESSAGE};
bless $self, $class;
return $self;
}
sub send {
my ($self, $user, $msg) = @_;
my $date = Mail::Sendmail::time_to_date();
$mail{Message} .= <<""
Message sent on $date
From $ENV{REMOTE_ADDR}
All information contained in this message do not reflect the
ideas of Devin Austin or MorningStarWeb and it's affiliates.
;
if (sendmail %mail) {
print STDERR $Mail::Sendmail::error;
} else {
print STDERR "Error sending mail ($date): $!";
}
}
####
my $obj = PL->new;
$obj->Mail->send(
subject => 'Comments from ' . $q->param('name'),
message => $msg
);