ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activeperl
activeperl
RE: Getting Mime::Lite working on Windows
by Paula J Capacio other posts by this author
Apr 23 2008 1:21PM messages near this date
Re: Getting MIME::Lite working on Windows | ActivePerl 822 and Windows GUI look/feel
>  On April 23, 2008, "Curtis Leach" <cleach@[...].com> 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
ActivePerl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Curtis Leach
Octavian Rasnita
Curtis Leach
Bill Luebkert
Paula J Capacio

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved