title: Python Flask SMTPAuthenticationError: (535, '5.7.0 Invalid login or password')
body: <p>I'm currently getting SMTPAuthenticationError: (535, '5.7.0 Invalid login or password') error. I'm trying to send a email to a user upon registering their account. but when I test this feature I keep getting this error. I made sure my gmail account information were correct aswell. I'm following up with this tutorial <a href="https://realpython.com/blog/python/handling-email-confirmation-in-flask/#add-email-confirmation" rel="nofollow">https://realpython.com/blog/python/handling-email-confirmation-in-flask/#add-email-confirmation</a></p>
  
  <pre><code>class BaseConfig(object):
      """Base configuration."""
  
      # main config
      SECRET_KEY = 'my_precious'
      SECURITY_PASSWORD_SALT = 'my_precious_two'
      DEBUG = False
      BCRYPT_LOG_ROUNDS = 13
      WTF_CSRF_ENABLED = True
      DEBUG_TB_ENABLED = False
      DEBUG_TB_INTERCEPT_REDIRECTS = False
  
      # mail settings
      # defaults are:
      #  - MAIL_SERVER = 'smtp.googlemail.com'
      #  - MAIL_PORT = 465
      #  - MAIL_USE_TLS = False
      #  - MAIL_USE_SSL = True
      MAIL_SERVER = os.environ.get('APP_MAIL_SERVER', 'smtp.googlemail.com')
      MAIL_PORT = int(os.environ.get('APP_MAIL_PORT', 465))
      MAIL_USE_TLS = _get_bool_env_var('APP_MAIL_USE_TLS', False)
      MAIL_USE_SSL = _get_bool_env_var('APP_MAIL_USE_SSL', True)
  
      # mail authentication
      MAIL_USERNAME = os.environ.get('APP_MAIL_USERNAME', None)
      MAIL_PASSWORD = os.environ.get('APP_MAIL_PASSWORD', None)
  
      # mail accounts
      MAIL_DEFAULT_SENDER = 'dahalbiplovechs@gmail.com'
  </code></pre>
  
  <p>I've made sure MAIL_SERVER and my account information are all accurate and have refferred back to another similar post no luck for the fix</p>