【发布时间】:2012-07-10 16:33:58
【问题描述】:
当我尝试通过 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密码/用户名是根据this page从Heroku获取的
有人有什么建议吗?
【问题讨论】:
-
您是否通过
herokucli 将 RAILS_ENV 和 RACK_ENV 设置为“暂存”? -
验证您已通过
heroku config设置了 SendGrid 凭据 -
是的,我将 RAILS_ENV 和 RACK_ENV 设置为“暂存”。但我无法发送邮件..