question: how to login to gmail smtp from python
Question:
I need to send email from python with gmail but
after 30 of may 2022 google blocked auth from less secure apps.
Does anyone know how to login now?
Answers:
The best way to login to Gmail SMTP from Python is to use OAuth 2.0 authentication. OAuth 2.0 is a secure authentication protocol that allows users to grant applications access to their data without having to share their username and password. To use OAuth 2.0 authentication with Gmail, you will need to register your application with Google, get the client ID and client secret, and provide the scopes that your application needs to access the user’s data. Once your application is registered, you can use the Google API Client Library for Python to generate an access token and use it to authenticate with Gmail.
I need to send email from python with gmail but
after 30 of may 2022 google blocked auth from less secure apps.
Does anyone know how to login now?
The best way to login to Gmail SMTP from Python is to use OAuth 2.0 authentication. OAuth 2.0 is a secure authentication protocol that allows users to grant applications access to their data without having to share their username and password. To use OAuth 2.0 authentication with Gmail, you will need to register your application with Google, get the client ID and client secret, and provide the scopes that your application needs to access the user’s data. Once your application is registered, you can use the Google API Client Library for Python to generate an access token and use it to authenticate with Gmail.