Mail::SendEasy defaulting to localhost?


D

Dan

Dear All,

Trying to put together a simple script that sends out email via my SMTP
server (ISP requires authentication). I run this app through Terminal
(mac os-x.tiger.5), but it prints...

ERROR: Can't connect to localhost:25

Why is it trying to connect to localhost? Shouldn't it be connecting to
mail.yadayadayada.com?

Do I need an SMTP server running locally as well? My static IP address
isn't attached to any domain name, so I can't really use
sendmail/postfix to send email reliably (it just gets rejected as
spam).

Any clues? Am I missing something? I can't find anything in the
(limited) documentation that explains this issue, and the web hasn't
proved much use either - just dozens of links to a similar (unanswered)
question from 2005.

Any help really appreciated.

Dan




#!/usr/bin/perl

use Mail::SendEasy ;

my $mail = new Mail::SendEasy(
smtp => 'mail.yadayadayada.com' ,
user => 'yada' ,
pass => 'yadayada',
) ;

my $status = $mail->send(
from => '(e-mail address removed)' ,
from_title => 'Yada' ,
to => '(e-mail address removed)' ,
subject => "MAIL Test" ,
msg => "The Plain Msg..." ,
html => "<b>The HTML Msg...</b>" ,
msgid => "0101" ,
) ;

if (!$status) { print $mail->error ;}
 
Ad

Advertisements

M

Martin Kißner

Dan wrote :
Dear All,

Trying to put together a simple script that sends out email via my SMTP
server (ISP requires authentication). I run this app through Terminal
(mac os-x.tiger.5), but it prints...

ERROR: Can't connect to localhost:25

Why is it trying to connect to localhost? Shouldn't it be connecting to
mail.yadayadayada.com?

I can not answer your question but I have used Mail::Sender sucessfully
on Mac OS X 10.2 - 10.4.
It is quite easy to use.
Do I need an SMTP server running locally as well? My static IP address
isn't attached to any domain name, so I can't really use
sendmail/postfix to send email reliably (it just gets rejected as
spam).

You do have a SMTP server running locally by default. It is the postfix
mailserver controlled by launchd.
Maybe you have disabled it in the file
"/System/Library/LaunchDaemons/org.postfix.master.plist"

Have you tried setting $myorigin to a valid domainname to avoid emails
being rejected as spam? It is good that you have a static IP address
because some MTA reject connections from Dynamic IP addresses.

There is also another option.
You could write a transport module using Net::SMTP and MIME::Base64
which logs into your ISP's Mailserver with authentication.
Then you can setup your postfix to use this transport module for all
outgoing email or based on special criteria (i.e. the domain part of the
recipients address).
But actually this should not be necessary.
I used to do this, to get arround the rejection because of dynamic IP
addresses. If you can not solve your problem, you can have my script
(with no warranty ;))

HTH
Best regards
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top