Rails 4 ActionMailer with gmail Net :: SMTPAuthenticationError:534-5.7.14 [英] Rails 4 ActionMailer with gmail Net::SMTPAuthenticationError: 534-5.7.14
问题描述
我正在尝试发送电子邮件到我的应用程序的开发版本。没有什么我在做的正在工作。我不断受到打击:
Net :: SMTPAuthenticationError:534-5.7.14 https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=blahblahblah
I am trying to send an email in development version of my app. Nothing I am doing is working. I keep getting hit with: Net::SMTPAuthenticationError: 534-5.7.14 https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=blahblahblah
其他SO帖子我遵循:
的邮件来自-rails-app-on-staging-envir>
Net::SMTPAuthenticationError when sending email from Rails app (on staging environment)
< a href =https://stackoverflow.com/questions/25209676/running-into-smtp-error-when-trying-to-send-email-in-ror-app>尝试发送电子邮件时出现SMTP错误在RoR应用程序
...等等,没有任何作用。如果不能解决,我要撕掉我的大脑。我花了这么长时间在这个...
... etc... and nothing works. I'm going to tear my brains out if can't be resolved. I have spent so long on this...
我已经尝试直接去 http://www.google.com/accounts/DisplayUnlockCaptcha ,然后点击继续,没有结果。我已经在我的Google帐户设置启用了较少安全的应用访问(Google - >安全 - >帐户权限 - >访问)。我已经尝试去错误后发布的链接,并从那里登录,没有结果。
I have tried going directly to http://www.google.com/accounts/DisplayUnlockCaptcha and click continue, no results. I have already in my google account settings enabled less secure apps access(Google -> Security -> Account permissions -> Access). I have tried going to the link posted after the error, and logged in from there, and no results.
我在config / environments / development.rb中设置
My setup in config/environments/development.rb
config.action_mailer.default :charset => "utf-8"
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'mysite.com',
user_name: ENV['MAIL_EMAIL'],
password: ENV['MAIL_PASS'],
authentication: 'plain',
enable_starttls_auto: true
}
如果这有任何区别:
从apache错误日志:
From the apache error logs:
警告:基于名称的SSL虚拟主机仅适用于具有TLS服务器名称指示支持的客户端
我正在托管两个域相同的IP地址。
I am hosting two domains on the same IP address.
我将rails应用程序切换到生产模式,看看是否有帮助。没有结果。
I switched my rails app to production mode, to see if it would help. No results.
请帮助。
推荐答案
转到你的Google帐户设置,找到安全 - >帐户权限 - >访问不太安全的应用程序
,启用此选项。
Go to your Google Account settings, find Security -> Account permissions -> Access for less secure apps
, enable this option.
关于此选项: https://support.google.com/accounts/answer/6010255
这篇关于Rails 4 ActionMailer with gmail Net :: SMTPAuthenticationError:534-5.7.14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!