develooper Front page | perl.beginners | Postings from December 2003

RE: Mail::Sender weirdness

Thread Previous | Thread Next
From:
Dan Muey
Date:
December 29, 2003 08:48
Subject:
RE: Mail::Sender weirdness
Message ID:
D6D77DB239A2004BB08A240E2E71460D12C2B3@LSLOFFICE.infiniplex.infiniplex.com
> From: "Dan Muey" <dmuey@infiniplex.com>
> > Here's wht I have:
> > $r .= "Sending...";
> > eval {
> >   my $senderx = new Mail::Sender {smtp => $smtp, from => $from };
> 
> You forgot to tell Mail::Sender to die in case of an error :-)

Oohhhhhhh, yeah :) Thanks

> 
> >   $senderx->Open({subject => $subj, to => $to });
> >   $senderx->SendLineEnc($msg); $senderx->Close();
> > };
> > if($@) { $r .= "Error sending mail: $@ -- 
> $Mail::Sender::Error <br /> 
> > \n"; } else {  $r .= "Done <br /> \n"; }
> > 
> > The issue I'm seeing is this:
> > 
> > If $to is a local address on $smtp (IE the same server this 
> scirpt is
> > on) It sends no problem regardless of where $from 's server is at.
> > 
> > If I set $to to an address on the other server and $from to a local 
> > address(or anythgin) it won't go.
> 
> I bet the server is set up to disallow "relay". So either the sender 
> or the adressee has to be local. Or you have to authenticate.

One of them is always local I'll try the authentication bit again.

> 
> > The thing is I get "Sending...Done" everytime but never a 
> dleivery and 
> > no hinf tof it in the logs. On one server I needed to use smtp 
> > authentication but that set $@ and said connection couldn't be made.
> > 
> > Any ideas what I'm missing would be awesome!
> 
> By default Mail::Sender does not raise exceptions. It returns 
> negative error codes.
> 

Right on! I'll take a look at your cpan page again and redo my problem handling angle.

As usual you rock!

> Jenda




Thread Previous | Thread Next


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