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

Here's my code :
use MIME::Lite $msg = new MIME::Lite From=>'email1@hotmail.com', To=>'email2@hotmail.com', Subject=>'SUBJECT OF MESSAGE', Type=>'TEXT', Data=>"THIS IS THE MESSAGE"; $msg->send("SMTP");
I always have this error: "The system cannot find the path specified"
Is there something i have to specified because i'm under Win2000 and we use exchange Server where i'm working. I'm pretty confuse about it.
Thanks for your help
edited by boo_radley : code tags

Replies are listed 'Best First'.
Re: Send a mail using MIME::Lite
by Joost (Canon) on Jan 28, 2003 at 14:43 UTC
    You have quite a lot of errors in your code. in fact you probably did not get this code from the program you are running.

    Something like this seems to work:

    #!/usr/bin/perl -w # note: -w use strict; # note: strictness use MIME::Lite; # note: ends with ; my $msg = MIME::Lite->new( # note: ->new( From=>'some@email', To=>'some@email', Subject=>'SUBJECT OF MESSAGE', Type=>'TEXT', Data=>"THIS IS THE MESSAGE" ); # do not forget this $msg->send("smtp","smtp.something.addr"); # note: small letters # and smtp server
    Your problem (amongst others) is probably that you don't have a default SMTP server specification.

    It would probably also help to Read The Manual.

    -- Joost downtime n. The period during which a system is error-free and immune from user input.
Re: Send a mail using MIME::Lite
by helgi (Hermit) on Jan 28, 2003 at 15:05 UTC
    You need to specify the SMTP server, as in
    $msg->send("smtp"=>$mail_server, Timeout=>60);

    --
    Regards,
    Helgi Briem
    helgi AT decode DOT is