#100DaysOfCode in Python Transcripts
Chapter: Days 64-66: Sending emails with smtplib
Lecture: Obtaining your Gmail App ID

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


Talk Python's Mastodon Michael Kennedy's Mastodon