【发布时间】:2018-08-07 11:52:14
【问题描述】:
它在 5 分钟前适用于我的其他 Gmail 帐户,所以我知道我的配置都是正确的,但现在我遇到了身份验证错误。我刚刚创建了一个新的 Gmail 帐户并更改了我的 development.rb 文件中的用户名和密码,现在它不起作用。
config.action_mailer.default_url_options = { host: "locahost:3000" }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:enable_starttls_auto => true,
:user_name => ENV['gmail_username'],
:password => ENV['gmail_password'],
:domain => 'localhost',
:authentication => :plain
}
这个帖子上次帮助了我,但就像我说的那样,我不知道还能尝试什么..? Net::SMTPAuthenticationError when sending email from Rails app (on staging environment)
对于我的新 Gmail 帐户双因素身份验证已关闭,我打开了该设置以允许安全性较低的应用程序,就像我必须为我的其他帐户一样。而且我还去了https://accounts.google.com/DisplayUnlockCaptcha 并允许帐户访问。不知道我错过了什么......可能是一些愚蠢的事情。
【问题讨论】:
标签: ruby-on-rails gmail