I want to send Gmail with Python, but I can't because of an error

I enrolled in a Python online course from this morning. I can't understand immediately after entering the paid content.

"Send Gmail in Python"

e? ?? Can't you do that?

But I can't.

from email import message import smtplib smtp_host = 'smtp.gmail.com' smtp_port = 587 from_email ='sender's address' to_email ='address of the person you want to send' username ='your address' password ='password' msg = message.EmailMessage() msg.set_content('test mail') msg['Subject'] = 'test mail(sub)' msg['From'] = from_email msg['To'] = to_email server = smtplib.SMTP(smtp_host, smtp_port) server.ehlo() server.starttls() server.ehlo() server.login(username, password) server.send_message(msg) server.quit()

I want to post the error text, but I can't because I don't know which one is personal information ... p=WantAuthError I'm curious about this written at the end, but it doesn't appear even if I search ... I wonder why. .. .. .. If you know, please give me some advice! !! !! !!

never give up

Recommended Posts

I want to send Gmail with Python, but I can't because of an error
I want to debug with Python
I want to specify another version of Python with pyvenv
I'm an amateur on the 14th day of python, but I want to try machine learning with scikit-learn
I want to output the beginning of the next month with Python
I want to analyze logs with Python
I want to play with aws with python
I want to extract an arbitrary URL from the character string of the html source with python
I want to do it with Python lambda Django, but I will stop
I want to tweet on Twitter with Python, but I'm addicted to it
I want to color a part of an Excel string in Python
Send an email to Spushi's address with python
I want to make a game with Python
I want to be an OREMO with setParam!
I want to use Temporary Directory with Python2
#Unresolved I want to compile gobject-introspection with Python3
I want to solve APG4b with Python (Chapter 2)
I want to write to a file with Python
[Python] I want to know the variables in the function when an error occurs!
To automatically send an email with an attachment using the Gmail API in Python
I tried to automatically send the literature of the new coronavirus to LINE with Python
I want to convert an image to WebP with lollipop
I tried to implement an artificial perceptron with python
I want to inherit to the back with python dataclass
I want to work with a robot in python.
I want to AWS Lambda with Python on Mac!
[ML Ops] I want to do multi-project with Python
I want to run a quantum computer with Python
I want to get an error message in Japanese with django Password Change Form
Send using Python with Gmail
I tried to find the entropy of the image with python
I want to be able to analyze data with Python (Part 3)
[Python] Send an email from gmail with two-step verification set
I tried various methods to send Japanese mail with Python
I want to be able to analyze data with Python (Part 1)
I want to start a lot of processes from python
I want to be able to analyze data with Python (Part 4)
I want to color black-and-white photos of memories with GAN
I want to be able to analyze data with Python (Part 2)
I want to automatically attend online classes with Python + Selenium!
[Python] I want to use the -h option with argparse
I want to send a message from Python to LINE Bot
I want to know the features of Python and pip
[Python] I want to make a 3D scatter plot of the epicenter with Cartopy + Matplotlib!
I want to improve efficiency with Python even in an experimental system (2) RS232C and pySerial
I want to improve efficiency with Python even in an experimental system (1) Install Anaconda with Chocolatey
I can't install python3 with pyenv-vertualenv
I sent an SMS with Python
I want to do ○○ with Pandas
[Python] Send an email with outlook
[Python] Create API to send Gmail
Send email via gmail with Python 3.4.3.
I want to use a wildcard that I want to shell with Python remove
I want to know the weather with LINE bot feat.Heroku + Python
I want to monitor UNIQLO + J page updates [Scraping with python]
I want to solve APG4b with Python (only 4.01 and 4.04 in Chapter 4)
I get an error when trying to install maec 4.0.1.0 with pip
I tried to create a list of prime numbers with python
I want to do a full text search with elasticsearch + python
I want to use an external library with IBM Cloud Functions
I tried to fix "I tried stochastic simulation of bingo game with Python"