認証にauthlogicを使用し、herokuにデプロイされているRails3.1アプリでsendgridがメールを正常に送信するのに問題があります。config / environment/[development.rbおよびproduction.rb]に次のアクションメーラー構成があります。
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.default_charset = "utf-8"
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => 587,
:domain => ENV['SENDGRID_DOMAIN'],
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:authentication => 'plain',
:enable_starttls_auto => true
}
Production.rbの場合、上記のコードは次の点を除いて同じです。
config.action_mailer.default_url_options = { :host => [app name in heroku] }
開発モードで実行すると、次のエラーが報告されます。
Completed 500 Internal Server Error in 21740ms
Net::SMTPFatalError (550 Cannot receive from specified address notification@[app-domain]: Unauthenticated senders not allowed
):
私は今、それを機能させるためにそれを設定する方法を本当に知りません。herokuとrailsにsendgridをセットアップした経験のある人は、何が起こっているのか知っていますか?
どうもありがとうございます。君たちは最高です!!!