in reply to Re: Re: Re: Mail::Sender issue
in thread Mail::Sender issue
my original scenario I have Mail::Sender wrapped in a wrapper class (for reasons that are missing in this example script) which is represented here by csMail:
#------------------------------------- # PACKAGE INFO package csMail; $VERSION = .2; #------------------------------------- # PRAGMAS use strict; use utf8; #------------------------------------- # 3RD PARTY MODULES use Mail::Sender; #================================================================ sub new { my ($class,%args) = @_; $args{smtp} = 'smtp.nycap.rr.com'; $args{port} = 25; $args{from} = 'default_from' if not defined( $args{from} ); $args{replyto} = $args{from} if not defined( $args{replyto} ); ref( my $sender = new Mail::Sender {%args} ) or die $Mail::Sender: +:Error; my $self = bless { sender => $sender }, $class; return $self; } #---------------------------------------------------------------- sub MailMsg { my ($self,%args) = @_; return $self->{sender}->MailMsg(%args); } #---------------------------------------------------------------- sub MailFile { my ($self,%args) = @_; return $self->{sender}->MailFile(%args); } #================================================================ sub descError { return $Mail::Sender::Error; }
Here is the script that calls it, generating the same error
#------------------------------------- # PRAGMAS use strict; use utf8; #------------------------------------- # IN HOUSE MODULES use csMail; #=================================================== ref( my $mailer = csMail->new() ) or die csMail::descError; $mailer->MailMsg( to => 'stephen@crescentsun.com', msg => 'test message body', subject => 'test subject' ) or warn $mailer->descError();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Mail::Sender issue
by suaveant (Parson) on May 04, 2001 at 22:28 UTC | |
by AidanLee (Chaplain) on May 04, 2001 at 22:36 UTC | |
by suaveant (Parson) on May 04, 2001 at 22:38 UTC |