Sending EMAILS with PYTHON: 5 minute tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video I'll be going over how to send an automated email using python we will be using the smt player module so to get started let's initialize some variables such as the email which we'll be sending the uh in the email so the sender email then we will have the receiver email and now we will have the uh actual message so the actually first we can have the subject of the email and now we will have the actual message so input message and now the actual text that will be sent will look something like this so we will have the subject in front subject variable then two new lines and then B message now we will have to start the smt blip server using a CMT uh SMTP here we will have smtp.gmail.com and the port of 587 then we will start with TLS for the server and now we log in to the server using the sender email so the email and here since May 2022 you do not use the password to log in we have to use something called an app for a security key or app password to find this app password for your email account you can go to Google to the app password section to find it you can just search on Google Google app passwords and this one is it so if it says that this option is not available for your account you need to make sure that 2fa is enabled on your account so after you enable 2fa here just click select device custom just put in whatever you want so this key here will be the password which will be used to login so just copy it click done and now here we can paste it so after we logged in to the server we can actually just send the email so server dot send mail to the uh so the email will send it to the receiver and the last argument is to be the message I mean the text this variable here so now this is done we can just put a nice print statement email hasn't been sent to you know and this should be it so now if I run this the sender email would be one of will be this email account which I have here the receiver email will do in my email the subject will be uh python let's say python email the message will be this email has been sent with python and let's make a new line very cool so now if I click enter the email has been sent so now if I go to my Gmail inbox you can see here I have a new email python email this email has been sent with python very cool oh I guess new lines don't actually work so this is it this is how you can send an automated email with python it's pretty easy you can send as many emails as you want you can like do a while loop to spam emails or whatever or you can have a list of emails to which you want to send in this email so it's pretty useful if you found this video informative make sure to like And subscribe
Info
Channel: Just Another Coder
Views: 6,717
Rating: undefined out of 5
Keywords: python, python tutorial, python programming, coding, programming, programming tutorial, coding tutorial, hacking, hacker, hacking tutorial, email, gmail, automation, automated, ai, chat gpt, future, spam, email spam, automated emails, tutorial, hack, webdev, website, ethical hacking, developer, coder
Id: ueqZ7RL8zxM
Channel Id: undefined
Length: 4min 38sec (278 seconds)
Published: Fri Jul 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.