【发布时间】:2015-01-12 12:50:37
【问题描述】:
我正在尝试在我的应用程序的开发版本中发送电子邮件。我所做的一切都不起作用。我不断受到打击: Net::SMTPAuthenticationError: 534-5.7.14 https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=blahblahblah
我关注的其他 SO 帖子:
Net::SMTPAuthenticationError when sending email from Rails app (on staging environment)
Running into SMTP error when trying to send email in RoR app
... 等等... 没有任何效果。如果不能解决,我会绞尽脑汁。我花了这么长时间...
我试过直接去http://www.google.com/accounts/DisplayUnlockCaptcha然后点击继续,没有结果。我已经在我的 google 帐户设置中启用了不太安全的应用程序访问(Google -> 安全 -> 帐户权限 -> 访问)。我已经尝试转到错误后发布的链接,并从那里登录,但没有结果。
我在 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 错误日志:
警告:基于名称的 SSL 虚拟主机仅适用于支持 TLS 服务器名称指示的客户端
我在同一个 IP 地址上托管两个域。
我将我的 rails 应用程序切换到生产模式,看看它是否有帮助。没有结果。
请帮忙。
【问题讨论】:
-
你有没有找到解决这个问题的方法?
标签: ruby-on-rails email ruby-on-rails-4 gmail actionmailer