私は Rails 3 を実際に動かして、実際の電子メールを送信するセクションを調べてきました。Gmail アカウントにメールを送信する機能を実行すると、メールは受信されますが、送信元アドレスは ではなく Gmail としても設定されますticketee@gmail.com
。私はデフォルトの :from setup も持っています:
class Notifier < ActionMailer::Base
default from: "ticketee@gmail.com"
def comment_updated(comment, user)
@comment = comment
@user = user
mail from: "ticketee@gmail.com", to: user.email, subject: "[ticketee] #{comment.ticket.project.name} - #{comment.ticket.title}"
end
end
なぜこれが起こっているのかについてのアイデアはありますか?
編集
上記のアドレスを私の gmail に変更しました。テスト応答として nil を取得しなくなりました。ただし、別の問題が発生しているようです。
Then there should be an email from Ticketee in my box # features/step_definitions/app_email_steps.rb:20
deadlock; recursive locking (ThreadError)
<internal:prelude>:8:in `lock'
<internal:prelude>:8:in `synchronize'
./features/step_definitions/app_email_steps.rb:22:in `block (2 levels) in <top (required)>'
<internal:prelude>:10:in `synchronize'
./features/step_definitions/app_email_steps.rb:21:in `/^there should be an email from Ticketee in my box$/'
features/gmail.feature:32:in `Then there should be an email from Ticketee in my box'
Failing Scenarios:
cucumber features/gmail.feature:20 # Scenario: Receiving a real-world email