smtplib.SMTPAuthenticationError: (534, b'5.7.9 Application-specific password required. Learn more at\n5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor h22sm15927247pfv.25 - gsmtp')
Environment variable are set but does not work (even though it's the exact value).
export EMAIL_USER='[email protected]'os.environ.get('EMAIL_USER') and the mail value string is TrueI am trying to import this in config file, when I use harcoded values it worked fine, but use I use os.environ.get('EMAIL_USER'), it stops working and throws this error.
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.
https://support.google.com/accounts/answer/185833?hl=en
Use apps password such as EMAIL_USER="example.com" EMAIL_PASSWORD="twtsxiraaxpcuhuyp". If you do not have a gmail apps password, create a new app with using generate password. Check your apps and passwords https://myaccount.google.com/apppasswords. Good Luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With