stonecolddevin has asked for the wisdom of the Perl Monks concerning the following question:
if to is not passed, it defaults to my email address. The other two, however, are required.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 <noreply@dhoss.cjb.net>'; $mail{To} = $self->{TO} ? $self->{TO} : 'Devin Austin + <devin.austin@gmail.com>'; $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 );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problematic OO
by castaway (Parson) on Aug 03, 2005 at 09:05 UTC | |
|
Re: problematic OO
by polypompholyx (Chaplain) on Aug 03, 2005 at 09:17 UTC | |
by stonecolddevin (Parson) on Aug 03, 2005 at 19:43 UTC | |
|
Re: problematic OO
by greenFox (Vicar) on Aug 03, 2005 at 09:01 UTC | |
by stonecolddevin (Parson) on Aug 03, 2005 at 09:03 UTC | |
by greenFox (Vicar) on Aug 03, 2005 at 09:11 UTC | |
by stonecolddevin (Parson) on Aug 03, 2005 at 19:41 UTC | |
by holli (Abbot) on Aug 03, 2005 at 09:10 UTC | |
|
Re: problematic OO
by umbra (Acolyte) on Aug 03, 2005 at 10:42 UTC |