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

Monks, i am working in windows 2000 with outlook express mail, when i executed the following code, it is not sending the mail, there is no error reported. Am i missing anything?

use MIME::Lite; use Net::SMTP ; ### Start with a simple text message: $msg = MIME::Lite->new( From => 'mymail.info', To => 'mymail1.info', Cc => 'mymail2.info', Subject => 'A message with 2 parts...', Type => 'TEXT', Data => "Here's the GIF file you wanted", ); ### Send in the "best" way (the default is to use "sendmail"): #$msg->send();

Replies are listed 'Best First'.
Re: MIME::Lite question
by jbrugger (Parson) on Jun 15, 2005 at 10:10 UTC
    Where is your mailserver set?
    if ($I_DONT_HAVE_SENDMAIL) { MIME::Lite->send('smtp', "smtp.myisp.net", Timeout=>60); }

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

      for outgoing mails - SMTP sever and for incoming mails - POP3

Re: MIME::Lite question
by marto (Cardinal) on Jun 15, 2005 at 10:11 UTC
    Hi,

    Try un commenting the #$msg->send(); so that it reads $msg-send();.
    You may also wish to read the documentation which shows examples and details configuration as you need to specify a mail server.

    Hope this helps,

    Cheers

    Martin

      Thanks for the replies, even after removing the comment it is not working

        Hi,

        If all you have done is un comment that line its not going to work.
        Have you specified a mail server as indicated in the previous posts by jbrugger and myself?
        If you have supplied details for a mail server, make sure they are valid and that the mail server can be reached from the system the script is running on.
        Failing that, please post the code you now have.

        Hope this helps,

        Cheers

        Martin
Re: MIME::Lite question
by chanio (Priest) on Jun 16, 2005 at 06:25 UTC
    Hi,

    Try this tutorial: How to send emails in perl

    It is a very simple one, and has links to simplify it more or explain you about MIME::Lite completely!

    It is a good starting point because perldocs use to supose that you have a LINUX or C programing base. Once you know what they are explaining, you are going to see it as something very simple. (then you should gain your experience by succeeding in some simple scripts).

    Hope it helps!

    .{\('v')/}   C H E E R   U P !
     _`(___)' ___a_l_b_e_r_t_o_________
    
    Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.
Re: MIME::Lite question
by kwaping (Priest) on Jun 15, 2005 at 15:01 UTC
    Can you please post the entire program that you are actually trying to run? It seems there are critical pieces of information that you haven't told us yet. For example, I sincerely hope you're not really trying to send mail to 'mymail.info' - or are you? Those are the types of questions that I'd like to see answered by posting the actual code being used. Thanks!
      use MIME::Lite; #### Start with a simple text message: $msg = MIME::Lite->new( From => 'francis@suresoft.info', To => 'thomas.g@suresoft.info', Subject => 'A message with 2 parts...', Type => 'TEXT', Data => "Here's the GIF file you wanted", ); $msg->send();

      Actually this is the first time i am using this module, i am working in windows 2000 and outlook express mail. For outgoing mails in our company we are using smtp server with ip address(192.168.1.5),and for incoming mail we are using pop3 server with same ip address. The name of the server is Intranet.suresoft.info.

        Thank you! So that's the entire program? After reading through the docs for MIME::Lite, you might want to specify MIME::Lite->send("smtp"); at the beginning of your program, after the use line.