【发布时间】:2015-05-14 16:38:53
【问题描述】:
我正在尝试在 Rails 应用程序中使用针对 SendGrid 的 Google Cloud 优惠。在我的 config/environment/production.rb 中,我有:
config.action_mailer.delivery_method = :smtp
# SMTP Settings for use with SendGrid
ActionMailer::Base.smtp_settings =
{
:user_name => "myusername",
:password => "mypassword",
:domain => "mydomain",
:address => "smtp.sendgrid.net",
:port => 2525,
:authentication => :plain,
:enable_starttls_auto => true
}
它立即连接,我立即收到错误:
Net::SMTPAuthenticationError (535 Authentication failed: Bad username / password
我可以在网络上使用相同的凭据登录,没问题。有人知道为什么会这样吗?
【问题讨论】:
-
Sendgrid 通常需要端口 587。您为什么使用 2525?
-
因为谷歌云只允许2525
标签: ruby-on-rails google-app-engine sendgrid