重新发送确认错误

时间:2015-09-29 00:22:27

标签: ruby-on-rails devise smtp

我在我的Gmail上重新发送确认邮件时收到错误:

Devise中的Net :: SMTPAuthenticationError :: ConfirmationsController #create 534-5.7.14

def check_auth_response(res)
  unless res.success?
    raise SMTPAuthenticationError, res.message
  end
end

/development.rb

    ActionMailer::Base.smtp_settings = {
      address:            "smtp.gmail.com",
      port:               587,
      domain:             "localhost:3000",    
      user_name:          '...@gmail.com',
      password:           '...',
      authentication:     "login",
      :enable_starttls_auto => true
  }

1 个答案:

答案 0 :(得分:1)

仔细检查您的用户名和密码。将身份验证设置为" plain"。或者,您可能必须通过以下链接绕过Google的安全验证码(已解答here):http://www.google.com/accounts/DisplayUnlockCaptcha

ActionMailer::Base.smtp_settings = {
      address:            "smtp.gmail.com",
      port:               587,  
      user_name:          'username@gmail.com',
      password:           'password',
      authentication:     "plain",
      enable_starttls_auto: true
  }