Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Sending Mail from Perl Script

by thezip (Vicar)
on Apr 30, 2008 at 05:12 UTC ( #683622=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Sending Mail from Perl Script
in thread Sending Mail from Perl Script

Have you tried enabling Debug as I suggested? What were the resulting messages?

This might be a natural next step in the troubleshooting process.


Your wish is my commandline.


Comment on Re^3: Sending Mail from Perl Script
Re^4: Sending Mail from Perl Script
by Niner710 (Sexton) on Apr 30, 2008 at 16:02 UTC
    Hi, Yes, I tried the Debug=>1 option and got an error "Can't call method auth on an undefined value". When I tried to do it your way, it seems like the program hangs with the authorization part. I'm not sure why that is. My username and password are all correct. I've tried the username without the "@gmail.com" but still gives the same error. I'm wondering if I need SSL or anything for gmail. Can't seem to get my yahoo email account to work either. Maybe thats why the authorization is failing??
    use MIME::Lite; use Net::SMTP; $FROM='james@gmail.com'; $TO='james@hotmail.com'; $subject='TESTING 123'; $SMTPUSER='james@gmail.com'; $SMTPPASS='james1234'; $message_text='testing'; my $msg = MIME::Lite->new(From => $FROM,To => $TO,Subject => $subject, +Type => 'multipart/alternative'); my $smtp = new Net::SMTP('smtp.gmail.com:465', Timeout => 15, Debug => + 1); $smtp->auth($SMTPUSER, $SMTPPASS); $smtp->mail($FROM); $smtp->to($TO); $smtp->data($msg->as_string); $smtp->quit;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://683622]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (17)
As of 2014-04-17 16:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (453 votes), past polls