Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

How do I send email through GMail?

by stevieb (Canon)
on Jan 17, 2023 at 06:16 UTC ( #11149627=perlmeditation: print w/replies, xml ) Need Help??

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( '', Hello => '', 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('', '*app_password*') or die; $smtp->mail(''); $smtp->to(''); $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.

Replies are listed 'Best First'.
Re: How do I send email through GMail?
by jdporter (Chancellor) on Jan 17, 2023 at 15:58 UTC

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://11149627]
Approved by Arunbear
Front-paged by Arunbear
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2023-03-20 22:15 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (59 votes). Check out past polls.