Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor"

by vit (Friar)
on Mar 19, 2009 at 20:52 UTC ( [id://751871]=perlquestion: print w/replies, xml ) Need Help??

vit has asked for the wisdom of the Perl Monks concerning the following question:

I am getting
SMTP Failed to connect to mail server: Bad file descriptor
when running the following code on Windows
use MIME::Lite; my $msg=MIME::Lite->new(From=>"xx", To=>'xxx@xxx.com', Subject=>'Test MIME', Data=>"This is the test message"); $msg->send;
What am I missing?
  • Comment on MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor"
  • Download Code

Replies are listed 'Best First'.
Re: MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor"
by olus (Curate) on Mar 19, 2009 at 23:23 UTC

    Maybe two things. Not having sendmail installed and not having read the module's full documentation.

    If you have a server that can send mails for you, there is the send_by_smtp method to which you can specify that server's name.

    my $mailer = 'hostname'; $msg->send_by_smtp($mailer); # do some error checking
      /* Not having sendmail installed */

      how to check/install sendmail?
      and I guess I am not using it or I am mistaken?

        I recommend the second approach first, simply reading and understanding the module documentation. It explains the module defaults and what to do on Windows.

Re: MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor"
by Anonymous Monk on Mar 19, 2009 at 22:13 UTC
    sendmail, or a hostname.
      Could you please clarify.
Re: MIME::Lite returns "SMTP Failed to connect to mail server: Bad file descriptor"
by Anonymous Monk on Apr 28, 2009 at 10:22 UTC
    Try turning debug on with: MIME::Lite->send('smtp','host.com',Debug=>1);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://751871]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-12-07 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (50 votes). Check out past polls.