我安装发送网格启动器为我的heroku应用程序。Heroku上的SendGrid失败
我把这个在我到config/environment.rb:
ActionMailer::Base.smtp_settings = {
:user_name => ENV["SENDGRID_USERNAME"],
:password => ENV["SENDGRID_PASSWORD"],
:domain => "my-sites-domain.com",
:address => "smtp.sendgrid.net",
:port => 587,
:authentication => :plain,
:enable_starttls_auto => true
}
我创建这个类车型/ notifier.rb:
class Notifier < ActionMailer::Base
def notify()
mail(
:to => "[email protected]",
:subject => "New Website Contact",
:body => "body",
:message => "message",
:from => "[email protected]"
)
end
end
我把这个在另一个控制器发送电子邮件:
def contact
Notifier.notify().deliver
redirect_to("/", :notice => "We Have Received Your Request And Will Contact You Soon.")
end
当我部署,并尝试发送电子邮件我得到这个错误:
的Net :: SMTPAuthenticationError(535验证失败:错误的用户名/密码
我完全有设置发送网格,它说我已经准备好发送电子邮件。
我也跑heroku config --long
得到实际的密码和用户名,并硬编码他们,并仍然给了我相同的错误。
您是否已经通过[heroku sendgrid配置](https://devcenter.heroku.com/articles/sendgrid) – 2012-04-07 04:18:09
您的帐户是否已配置? – 2012-04-07 09:34:41