带有 gmail Net::SMTPAuthenticationError 的 Rails 4 ActionMailer:534-5.7.14 [英] Rails 4 ActionMailer with gmail Net::SMTPAuthenticationError: 534-5.7.14

查看:29
本文介绍了带有 gmail Net::SMTPAuthenticationError 的 Rails 4 ActionMailer: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 帖子:

Other SO posts I have followed:

从 Rails 发送电子邮件时出现 Net::SMTPAuthenticationError应用(在登台环境中)

当遇到 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 然后点击继续,没有结果.我已经在我的谷歌帐户设置中启用了不太安全的应用程序访问(谷歌 -> 安全 -> 帐户权限 -> 访问).我曾尝试转到错误后发布的链接,并从那里登录,但没有结果.

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 帐户设置,找到 Security ->帐户权限 ->访问不太安全的应用,启用此选项.

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

这篇关于带有 gmail Net::SMTPAuthenticationError 的 Rails 4 ActionMailer:534-5.7.14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆