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 Octavian Rasnita other posts by this author
Apr 23 2008 10:37AM messages near this date
Getting MIME::Lite working on Windows | RE: Getting MIME::Lite working on Windows
Instead of the line:

   $msg-> send ('smtp');

try:

   $msg-> send ('smtp', '127.0.0.1');

and replace 127.0.0.1 with the host or IP of the SMTP server you want to 
use.

Octavian

----- Original Message ----- 
From: "Curtis Leach" <cleach@[...].com> 
To: <activeperl@[...].com> 
Sent: Wednesday, April 23, 2008 7:28 PM
Subject: Getting MIME::Lite working on Windows


>  Hi All,
> 
>  I need some help with MIME::Lite on Windows.
> 
>  I'm running ActivePerl 5.8.8 Build 817 on all my Windows boxes & I just
>  finished installing the MIME-Lite-3.01 from the Active State PPM
>  repository, along with all the pre-requisite modules.
> 
>  I'm attempting to port a perl program from AIX Unix where this program
>  works down to Windows where it breaks.
> 
>  I only have a requirement to send out emails, not to receive any emails.
> 
>  The program uses "use strict;" & "use warnings" so I'm assuming I didn't
>  get something configured correctly on Windows.
> 
>  Can someone give me a hint or two to check out?
> 
>  Here's the relevant code from my program:
> 
>  eval
>  {
>    my %mail_args =  ( From     => $from,
>                       To       => $mail_list,
>                       Subject  => $subject,
>                       Type     => 'TEXT',
>                       Data     => $mail_body ) ;
>    my $msg = MIME::Lite->new( %mail_args  );
>    $msg->send ('smtp');
>  };
>  if ($@)
>  {
>    print STDERR "Failure sending email: $@\n";
>  }
> 
>  The call to $msg->send ('smtp') is throwing the following exception:
>  Failure sending email:  Failed to connect to mail server: Bad file
>  descriptor  at notify.pl line 478.
> 
>  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.
> 
>  If I try just $msg->send (), I just get a message that it can't find the
>  sendmail program and no exception is thrown.  And no email is sent out.
> 
>  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.
> 
>  Curtis
> 
> 
> 
>  _______________________________________________
>  ActivePerl mailing list
>  ActivePerl@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 

_______________________________________________
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
© ActiveState Software Inc. All rights reserved