【发布时间】:2017-10-06 11:55:11
【问题描述】:
我开设了一个 Google Apps 帐户并注册了电子邮件。我正在尝试使用 sidekiq 将它连接到我在 Heroku 上运行的 Rials 应用程序。 Letter opener 在开发方面运行良好,因此设置很好,但使用 Google 发送电子邮件不起作用。
这是 config/initializers/mailer.rb
ActionMailer::Base.helper "application"
ActionMailer::Base.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: domain.com,
user_name: name@domain.com,
password: gmailpassword,
authentication: 'plain',
# authentication: 'login',
tls: true,
enable_starttls_auto: true
}
生产.rb
config.action_mailer.default_url_options = { host: 'domainname.com' }
ActionMailer::Base.delivery_method = :smtp
在 Google 我关闭了两步验证,我打开了不太安全的应用程序等,但它无法正常工作。要么它显示验证错误。在更改设置等期间,我遇到了三个错误:
SMTPAuthenticationError
未捕获的异常:534-5.7.14
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=unknown state: unknown protocol
知道如何修复它并正确设置 gmail 吗?谢谢
【问题讨论】:
标签: ruby-on-rails email heroku