Skip to content

Instantly share code, notes, and snippets.

@mourdok
Created October 20, 2011 01:22
Show Gist options
  • Save mourdok/1300163 to your computer and use it in GitHub Desktop.
Save mourdok/1300163 to your computer and use it in GitHub Desktop.
Send email by GMail
#!/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