当我尝试通过 heroku cedar 堆栈上的 sendgrid 发送电子邮件时,出现以下错误:
ArgumentError (SMTP-AUTH requested but missing user name):
我在 /environments/staging.rb 中的设置是:
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'myapp' }
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => "587",
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com'
}
我的 Sendgrid 密码/用户名是根据这个页面从 Heroku 获得的
有人有什么建议吗?