> On April 23, 2008, "Curtis Leach" <[EMAIL PROTECTED]> said:
Subject: Getting MIME::Lite working on Windows
> I need some help with MIME::Lite on Windows.
> [snip]
> If I used the call I use for AIX unix,
>$msg->send ('smtp', 'localhost', Dbug=>0);
> I get the following message:
> Failure sending email: Failed to connect to mail server: Unknown
error
> at notify.pl line 478.
>
> So I'm assuming that it's because it can't locate the mail server to
use
> on the Windows platform.
>
> Is there any way to ask Windows what mail servers are available? I'd
> hate to have to hard code one that isn't available at all the
locations
> this program would be installed on. I'd rather add code to ask for
it.
>
I *think* 'localhost' is causing it to look for a mail server on your
local machine. Try setting 'localhost' to 'mailhost'. I'm using
MIME::Lite on windows and I don't hard code specific locations; I
use 'mailhost'.
I can't claim to know exactly why this works, but by specifying 'smtp',
you are indicating you want MIME::Lite to use the Net::SMTP module to
actually send the message. The help for that module indicates you can
find the actual mail server using the following code:
#(ie: asking what mail server is available)
use Net::SMTP;
$smtp = Net::SMTP->new('mailhost');
print $smtp->domain,"\n";
$smtp->quit;
HTH, Paula
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs