Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

How to send mail automatically using MIME::Lite

by vkp (Novice)
on Apr 08, 2014 at 15:38 UTC ( #1081517=perlquestion: print w/replies, xml ) Need Help??
vkp has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I am got a task to send Email so some group of people. This mail is to be send as per a scheduled calender. For this i am using MIME::Lite . Here is part of my code:

#!/usr/bin/perl -w use strict; use MIME::Lite; my $msg = MIME::Lite->new( From => '', To => '', Subject => 'TESTMSG' ); my $user="xyz"; my $pass="abc"; MIME::Lite->send('smtp','',AuthUser=>$user,AuthPass=>$pass);

Some times it shows Cannot connect to server, and sometimes nothing happens. My work field is actually related to electronics. So i have a very less knowledge about these SMTP server etc. things. Please help me for this work. Its urgent for me. If there is any other way to do so please explain. Thanks

Replies are listed 'Best First'.
Re: How to send mail automatically using MIME::Lite
by hippo (Monsignor) on Apr 08, 2014 at 15:52 UTC

    According to the MIME::Lite documentation, that code won't actually send anything. If you read it more closely you will see that you still have to call the "send" method on your $msg object. Try that.

    FWIW, I'd be a bit surprised if "" were actually an SMTP server, but you never know.

Re: How to send mail automatically using MIME::Lite
by karlgoethebier (Parson) on Apr 08, 2014 at 17:04 UTC

    BTW - please wait!

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1081517]
Front-paged by Arunbear
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2017-04-28 16:15 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (525 votes). Check out past polls.