Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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 => 'xyz@yahoo.com', To => 'xyz@yahoo.com', Subject => 'TESTMSG' ); my $user="xyz"; my $pass="abc"; MIME::Lite->send('smtp','yahoo.com',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 "yahoo.com" were actually an SMTP server, but you never know.

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

    BTW - please wait!

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1081517]
Front-paged by Arunbear
help
Chatterbox?
[TStanley]: I'm sitting in the airport in Tampa, Florida at the moment, getting ready to head home.
[talexb]: TStanley I'm flying to Vegas in two weeks time. After that flights leaving Vegas and Phoenix are late at night .. I've been hearing that it gets so hot that the air isn't dense enough for planes to take off. Weird. Guess you won't have that problem.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-06-23 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (548 votes). Check out past polls.