535-5.7.8 Username and Password not accepted

后端 未结 8 1844
逝去的感伤
逝去的感伤 2020-12-24 01:17

I have a contact form and after submitting I am getting a Net::SMTPAuthenticationError 535-5.7.8 Username and Password not accepted

It\'s pointing to th

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 01:52

    First, You need to use a valid Gmail account with your credentials.

    Second, In my app I don't use TLS auto, try without this line:

    config.action_mailer.smtp_settings = {
      address:              'smtp.gmail.com',
      port:                 587,
      domain:               'gmail.com',
      user_name:            'YOUR_USERNAME@gmail.com',
      password:             'YOUR_PASSWORD',
      authentication:       'plain'
      # enable_starttls_auto: true
      # ^ ^ remove this option ^ ^
    }
    

    UPDATE: (See answer below for details) now you need to enable "less secure apps" on your Google Account

    https://myaccount.google.com/lesssecureapps?pli=1

提交回复
热议问题