Skip to main content
Rollback to Revision 3
Source Link
sideshowbarker
  • 89.2k
  • 30
  • 219
  • 216

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here
deleted 7 characters in body
Source Link
Super Kai - Kazuya Ito
  • 42.6k
  • 23
  • 257
  • 253

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!Buy me a coffee!!

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

added 74 characters in body
Source Link
Super Kai - Kazuya Ito
  • 42.6k
  • 23
  • 257
  • 253

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Dec, 2022 Update:

You need to use an app password to allow your app to access your google account.

Sign in with App Passwords:

An App Password is a 16-digit passcode that gives a less secure app or device permission to access your Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

In addition, google hasn't allowed your app to access your google account with username(email address) and password since May 30, 2022. So now, you need username(email address) and an app password to access your google account.

Less secure apps & your Google Account:

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

How to generate an app password:

First, click on Account from 9 dots:

enter image description here

Then, click on App passwords from Security. *Don't forget to turn on 2-Step Verification before generating an app password otherwise you cannot generate an app password:

enter image description here

Then, click on Other (Custom name):

enter image description here

Then, put your app name, then click on GENERATE:

enter image description here

Finally, you could generate the app password xylnudjdiwpojwzm:

enter image description here

So, your code with the app password above is as shown below:

import smtplib

fromaddr = '[email protected]'
toaddrs  = '[email protected]'
msg = 'Why,Oh why!'
username = '[email protected]'
password = 'xylnudjdiwpojwzm' # Here
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username,password)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()

In addition, settings.py with the app password above in Django is as shown below:

# "settings.py"

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'xylnudjdiwpojwzm' # Here

Buy me a coffee!!

deleted 1 character in body
Source Link
Super Kai - Kazuya Ito
  • 42.6k
  • 23
  • 257
  • 253
Loading
added 2428 characters in body
Source Link
Super Kai - Kazuya Ito
  • 42.6k
  • 23
  • 257
  • 253
Loading
Post Undeleted by Martijn Pieters
Post Deleted by Martijn Pieters
Source Link
Super Kai - Kazuya Ito
  • 42.6k
  • 23
  • 257
  • 253
Loading