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

Re: Mail::Sender

Thread Previous
Jenda Krynicky
February 12, 2002 15:25
Re: Mail::Sender
Message ID:
From:           	Nikola Janceski <>

> 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 => ''}) || 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";


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

=========== == ==========
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About