Quantcast
Channel: Sending email via Gmail - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Sending email via Gmail

$
0
0

I have email sending code which doesn't work without any error messages (by "doesn't work" i mean all seams OK but i have no message in my mail box):

use strict;use warnings;use Email::Send;use Email::Simple::Creator;report_update();sub report_update {    my $mailer = Email::Send->new(        {            mailer      => 'SMTP::TLS',            mailer_args => [                Host     => 'smtp.gmail.com',                Port     => 587,                User     => $CONFIG{EMAIL_USER},                Password => $CONFIG{EMAIL_PASS},                Hello    => 'localhost',            ]        }    );    my $email = Email::Simple->create(        header => [            From    => $CONFIG{EMAIL_USER},            To      => $CONFIG{TARGET_EMAIL},            Subject => 'Updated info finded!',        ],        body => 'Updated info finded!',    );    eval { $mailer->send($email) };    die "Error sending email: $@" if $@;    print "Finished!\n";}

Could you give me a hint what's wrong with it?


Viewing all articles
Browse latest Browse all 2

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>