轨道4的ActionMailer与Gmail的Net :: SMTPAuthenticationError:534-5.7.14 [英] Rails 4 ActionMailer with gmail Net::SMTPAuthenticationError: 534-5.7.14
问题描述
我想在我的应用程序开发版发送电子邮件。没有我做的是工作。我不断收到击中:
的Net :: SMTPAuthenticationError:534-5.7.14 <一个href=\"https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=blahblahblah\">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帖子我跟了:
<一个href=\"http://stackoverflow.com/questions/18124878/netsmtpauthenticationerror-when-sending-email-from-rails-app-on-staging-envir\">Net::SMTPAuthenticationError从Rails应用程序发送电子邮件时(在临时环境)
<一个href=\"http://stackoverflow.com/questions/25209676/running-into-smtp-error-when-trying-to-send-email-in-ror-app\">Running到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...
我曾尝试直接前往<一个href=\"http://www.google.com/accounts/DisplayUnlockCaptcha\">http://www.google.com/accounts/DisplayUnlockCaptcha并点击继续,没有结果。我已经在我的谷歌帐户设置中启用不够安全的应用访问(谷歌 - >安全 - >帐户的权限 - >接入)。我试图要在错误发生后发布的链接,并从那里登陆,也没有结果。
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.
我在配置/环境/ 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.
请帮忙。
推荐答案
转到您的谷歌帐户设置,找到安全 - &GT;帐户权限 - &GT;不够安全的应用访问
,启用该选项。
Go to your Google Account settings, find Security -> Account permissions -> Access for less secure apps
, enable this option.
关于此选项:<一个href=\"https://support.google.com/accounts/answer/6010255\">https://support.google.com/accounts/answer/6010255
这篇关于轨道4的ActionMailer与Gmail的Net :: SMTPAuthenticationError:534-5.7.14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!