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.