RE: Getting MIME::Lite working on Windows
by Curtis Leach other posts by this author
Apr 25 2008 7:07AM messages near this date
Re: Getting MIME::Lite working on Windows
|
Re: Getting MIME::Lite working on Windows
Thanks to everyone who responded.
I ended up having to put the SMTP server name to use into a config file.
Since I couldn't figure out a way to ask Windows/Outlook in Perl what it
was configured to use.
Curtis
-----Original Message-----
From: Octavian Rasnita [mailto:orasnita@[...].com]
Sent: Wednesday, April 23, 2008 12:15 PM
To: Curtis Leach; activeperl@[...].com
Subject: 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
|