Every few years I try to update this post so that people are aware.

Question is how to send email through GMail, or otherwise a Google Account.

It's still easy, but different. The instructions can be found in the above link through your own research. It can be done.

I want to keep this knowledge alive. When I have difficulty and find a solution, I want others to know how I overcame it. We should all be able to send mail or text messages through our Google accounts.

use warnings; use strict; use Net::SMTP; my $smtp = Net::SMTP->new( 'smtp.gmail.com', Hello => 'local.example.com', Timeout => 30, Debug => 1, SSL => 1, Port => 465 ); # Password here is an app password. Need to enable 2FA on Google # account to generate one $smtp->auth('steve.bertrand@gmail.com', '*app_password*') or die; $smtp->mail('steve.bertrand@gmail.com'); $smtp->to('steve.bertrand@gmail.com'); $smtp->data(); $smtp->datasend("hey!\n"); $smtp->quit();

The above is copy and pastable working code. I'm all in with no obfu with my real email address. I'm good with seeing how the cards fall.


In reply to How do I send email through GMail? by stevieb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.