Ruby on rails电子邮件错误535-5.7.1不接受用户名和密码

RQ *_*ari 6 smtp ruby-on-rails

我尝试发送电子邮件时遇到错误.我正在尝试从localhost发送电子邮件..动作邮件设置是

ActionMailer::Base.smtp_settings = {

 :enable_starttls_auto => true,

 :address => "smtp.gmail.com",

 :port => 587,

 :domain => "mydomain.com",

 :authentication => :plain,

 :user_name => "do-not-reply@mydomain.com",

  :password => "mypassword"

 }
Run Code Online (Sandbox Code Playgroud)

当我第一次配置它时,电子邮件工作正常.但在发送4或5封电子邮件后,该功能停止工作,并向我显示此错误

Net :: SMTPAuthenticationError ............

535-5.7.1不接受用户名和密码.

哪里可能有问题?

谢谢..

djp*_*jp3 0

我也遇到了同样的问题,当我仔细检查密码时,我意识到我输入了错误的密码。

因此,错误可能是由错误的密码和可能的用户名错误引起的。更正用户名和密码后,请确保重新启动 Rails 应用程序。

我还假设您实际上并没有使用文字文本“mydomain.com”,对吧?