#100DaysOfCode in Python Transcripts
Chapter: Days 64-66: Sending emails with smtplib
Lecture: Obtaining your Gmail App ID
0:00 Okay, the first thing we want to do
0:02 is generate an application password or an application ID.
0:06 This is a specific code, a string
0:08 that we are going to insert into our script
0:12 that allows your script or you program to talk to Google
0:16 okay, this is going to talk to your Google account
0:19 and it'll give you a script access
0:21 into your Gmail account in order
0:23 to be able to send these emails, okay.
0:27 Naturally that needs to happen
0:28 or just anyone could script your account, right?
0:32 So we kind of want to have something like this.
0:34 Now I'm looking at a support.goggle Article 185833,
0:41 just write that number down, 185833
0:46 that is the article all about signing in
0:49 using application passwords.
0:51 If you go down to How To Generate An App Password
0:54 you can click on App Passwords here
0:57 that takes you to security.google.com
1:00 Settings, Security, App Passwords okay
1:06 don't worry these will all pop up on the screen
1:08 as you're watching this.
1:10 Now, let's just copy and paste that.
1:16 You'll be asked to log in, okay
1:19 enter your Gmail password or your
1:21 Google account password I should say
1:23 and then you can progress to the next screen.
1:33 Once we're logged in you can then see
1:35 any existing application passwords you might have running.
1:40 Probably the safest thing to do would be
1:42 to create one of these passwords per application, okay.
1:46 That way if it ever gets compromised
1:49 it's only really one, you can delete that
1:51 and you'll only impact one application.
1:55 Now to do this, to set one up, you click on
1:57 Select The App, now we want to work with our mail,
2:02 okay, so that's what we're going to select
2:04 select a device, now in this case,
2:07 we're going to choose Other, Custom Name
2:09 let's just call it 100 Days Script
2:13 alright and then we click on Generate.
2:17 And this will give us a nice pop up
2:19 with the application password in a yellow rectangle.
2:22 So like I said, it's going to be mapped to one application
2:27 store it in there maybe save it in a password vault
2:31 if you feel you're going to lose the application
2:33 or the environment variable just keep
2:36 very close tabs on this, understanding that
2:40 it has full access to your account, okay.
2:43 So be careful, be very careful
2:46 and, click on Done and then you'll be able to see it
2:49 in your current application passwords
2:52 and that's it, keep that password handy
2:54 we're going to need it in the next script.