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

I tried to use MIME lite in order to send an e-mail with attachment. I used the simple example found on the MIME lite documentation page. The mail server I am using does not need authentication and I downloaded the last version of MIME lite and Date::Format (as requested by MIME lite). Now I have this strange behaviour if I use linux everything works fine and the message is sent correctly, but with windows XP I receive always the message "I cannot connect to server unknown error". I tested the port 25 on the windows machine and it is not blocked, even if when I tried to do a telnet on this port the response is "I cannot connect". I am a bit confused. In the windows machine the firewall is deactivated but I have the MCfee antivirus on and I would like to keep it on. Can someone help me or tell me if there is a workaround to send e-mails with attachment in Windows? Thanks Marco

Replies are listed 'Best First'.
Re: MIME lite on Windows XP
by marto (Cardinal) on Nov 20, 2009 at 14:52 UTC

    'I tested the port 25 on the windows machine and it is not blocked, even if when I tried to do a telnet on this port the response is "I cannot connect"'

    Are you running the mail server on your XP machine? Are you using something like $msg->send('smtp','your.mailserver.here', Debug=>1 ); to send the mail?

    Martin

      Thanks for the answer. Well the mail server is not the windows machine where the perl script runs. I wrote the following code:

      use MIME::Lite; my $msg = new MIME::Lite To => 'anyone@somewhere.com', From => 'someone_else@where.com', Subject => 'Text Subject', Type => 'TEXT', Data => 'body of the text'; MIME::Lite->send('smtp', "some_valid_smtp_server_name", Timeout=>6 +0 Debug=>1); $msg->send; }

      where some_valid_smtp_server_name is a mail server. Such code it works in linux machine, but apparently does not work in windows xp. I also tried to use a thunderbird client (using the same configuration) in the windows and it works, so the mail port I think it is open. and the problem seems to be the perl script. The error is always in the line $msg->send; saying it fails the connection with the server. Some help please!!

        Try connecting to that SMTP server with telnet on Port 25. It should write a banner without further action. If telnet fails, perl can't work either, and you have a server problem.

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)