Created
October 20, 2011 01:22
-
-
Save mourdok/1300163 to your computer and use it in GitHub Desktop.
Send email by GMail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/ActivePerl-5.14/bin/perl -w | |
# | |
# Send email by GMail | |
# | |
# Libs | |
use Net::SMTP::TLS; | |
# Main | |
my $mailer = new Net::SMTP::TLS( | |
"smtp.gmail.com", | |
Hello => "smtp.gmail.com", | |
Port => 587, | |
User => "*****\@gmail.com", | |
Password => "*****" | |
); | |
$mailer->mail("*****\@gmail.com"); | |
$mailer->to("*****\@gmail.com"); | |
$mailer->data(); | |
$mailer->datasend("Sent from Perl!"); | |
$mailer->dataend(); | |
$mailer->quit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment