我安裝發送網格啓動器爲我的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