我一直在通過Rails 3的行動,發送真正的電子郵件部分。當我運行該功能發送電子郵件到我的gmail帳戶時,我收到郵件,但發件人地址也設置爲我的Gmail,而不是[email protected]
。我確實有默認值:從設置以及:rails3inaction發送到gmail
class Notifier < ActionMailer::Base
default from: "[email protected]"
def comment_updated(comment, user)
@comment = comment
@user = user
mail from: "[email protected]", to: user.email, subject: "[ticketee] #{comment.ticket.project.name} - #{comment.ticket.title}"
end
end
任何想法爲什麼這可能會發生?
編輯
改變從地址上面只是我的Gmail,我不再獲得零作爲測試反應。然而,它似乎遇到了不同的問題:
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
謝謝瑞安,我給了一個嘗試,但沒有去。然後我使用我的Gmail地址。但正如我在編輯中所解釋的,我似乎正在接受另一個錯誤。我應該嘗試一種不同的gmail gem版本嗎? – agmcleod
啊,死鎖遞歸錯誤...有時候會發生這種情況。我還沒有調查它爲什麼發生或如何解決它抱歉。 –