Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Send e-mail using perl

by rbala (Acolyte)
on Aug 07, 2012 at 08:28 UTC ( #985914=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Send e-mail using perl
in thread Send e-mail using perl

Using Mail::Sender module and printed the log message. See the below code:

#! /usr/bin/perl -w use Mail::Sendmail; %mail = ( To => 'xxx@gmail.com', From => 'yyy@gmail.com', Message => "This is a very short message" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log;
The following log message is obtained:

OK. Log says: Mail::Sendmail v. 0.79_16 - Tue Aug 7 13:27:58 2012 Date: Tue, 7 Aug 2012 13:27:58 +0530 Server: localhost Port: 25 From: xxx@gmail.com Subject: To: yyy@gmail.com Result: 250 2.0.0 q777vw5b026359 Message accepted for delivery

But i dont find any messages in inbox.


Comment on Re^4: Send e-mail using perl
Download Code
Re^5: Send e-mail using perl
by Anonymous Monk on Aug 07, 2012 at 08:34 UTC

    Message accepted for delivery

    But i dont find any messages in inbox.

    "accepted for delivery" means it is queued, its waiting to be sent, it is not the same as "delivered"

    Check your local mail account for bounce message (failure to deliver)

Re^5: Send e-mail using perl
by marto (Chancellor) on Aug 07, 2012 at 08:36 UTC

    I think you want to at least read and understand Mail::Sendmail and spend some time learning about how email works. You're using a local mail server, not the gmail platform. I suspect you'll find a bounce in your local mail server explaining why this message hasn't been delivered.

Re^5: Send e-mail using perl
by zentara (Archbishop) on Aug 07, 2012 at 14:34 UTC
    But i dont find any messages in inbox

    GMail is known by me for silently accepting and discarding messages. This module is good though. It prints out

    Attachments successfully verified With No attachments Sending email Mail sent!

    Try this:

    #!/usr/bin/perl use warnings; use strict; use Email::Send::SMTP::Gmail; my $mail=Email::Send::SMTP::Gmail->new( -smtp=>'gmail.com', -login=>'z@gmail.com', -pass=>'wadawada'); $mail->send(-to=>'z@gmail.com', -subject=>'Hello smtp test', -verbose=>'1', -body=>'Just testing it', # -attachments=> 'full_path_2_file', ); $mail->bye;

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-04-16 23:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (436 votes), past polls