From: "Dan Muey" <[EMAIL PROTECTED]>
> 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 :-)
> $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.
> 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.
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>