develooper Front page | perl.beginners | Postings from February 2002

Re: Mail::Sender

Thread Previous
From:
Jenda Krynicky
Date:
February 12, 2002 15:25
Subject:
Re: Mail::Sender
Message ID:
3C69B28E.19399.2B66694E@localhost
From:           	Nikola Janceski <nikola_janceski@summithq.com>

> Okay I am at a loss here...
> 
> I am using Mail::Sender to generate e-mails from a cgi page.
> I am successful with genereating it using a regular script run from a
> command line.
> 
> But when I put the code into my cgi it gives me this stupid error, (I
> upgraded the module to the latest). The code is almost an exact copy
> of one of the examples in the documentation. And funny how it dies in
> the module and not in my script.
> 
> Here is the code I am using:
> 
> [snip all the checking and crap]
> 
> use Mail::Sender;
> ref($sender = new Mail::Sender
>   {smtp => 'mailhost.xxxx.com'}) || die "$sender --
>   $Mail::Sender::Error\n";
> 
> $sender->OpenMultipart({from => $FORM{'from'}, cc => $FORM{'cc'},
>                        subject => $FORM{'subject'} } ) || die
> "$Mail::Sender::Error\n";

Don't ask me why but ... the method returns a the $sender object if 
successfull and a negative error number if not.

This should be 

ref $sender->OpenMultipart({from => $FORM{'from'}, 
	cc => $FORM{'cc'}, subject => $FORM{'subject'} } ) 
or  die "$Mail::Sender::Error\n";

or

ref( $sender->OpenMultipart({from => $FORM{'from'}, 
	cc => $FORM{'cc'}, subject => $FORM{'subject'} } ) 
) || die "$Mail::Sender::Error\n";

To make things worse ... ->SendFile() return 1 if successfull and 
negative number if not.

Do you get any helpfull error message now?

Sorry, Jenda


=========== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					--- me

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About