ActionMailer を使用して自動メール送信を使用して、heroku で Rails アプリケーションをセットアップしようとしています。メールの初期化のための私のセットアップは次のとおりです: ドメインとユーザー名はダミーであることに注意してください。
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "domain.edu",
:user_name => "name@wesleyan.edu",
:password => ENV['EMAIL_PASS'],
:authentication => "plain",
:enable_starttls_auto => true
}
奇妙なことに、あるアカウントでメールを送信しようとすると問題が発生せず、別のアカウントで送信しようとするとエラーが発生します。どちらでも認証プロセスを行ったことはありません。両方のレポートは次のとおりです。
成功:
2013-06-12T00:59:34.801877+00:00 app[web.1]: Sent mail to recipient@domainn.edu (2464ms)
2013-06-12T00:59:34.804391+00:00 app[web.1]: Redirected to http://test.herokuapp.com/
2013-06-12T00:59:34.806552+00:00 app[web.1]: Completed 302 Found in 3394ms (ActiveRecord: 289.6ms)
失敗:
2013-06-12T01:29:25.124493+00:00 app[web.1]: Rendered agreement_mailer/welcome_email.html.erb (23.7ms)
2013-06-12T01:29:26.079394+00:00 app[web.1]: app/controllers/agreements_controller.rb:106:in `block in create'
2013-06-12T01:29:26.079394+00:00 app[web.1]: ):
2013-06-12T01:29:26.078426+00:00 app[web.1]: Sent mail to madelman@wesleyan.edu (929ms)
2013-06-12T01:29:26.078426+00:00 app[web.1]: Completed 500 Internal Server Error in 1137ms
2013-06-12T01:29:26.079394+00:00 app[web.1]:
2013-06-12T01:29:26.079394+00:00 app[web.1]: Net::SMTPAuthenticationError (535-5.7.8 Username and Password not accepted. Learn more at
なぜこの不一致が発生するのかについて何か考えはありますか? 本当にありがとう。