如果我需要給2人發信,我該怎麼辦?我在網上找到了文檔,但我不明白他們,你能告訴我並用簡單的語言解釋我嗎?Actionmailer如何工作?
1
A
回答
5
def send_mail_persons(user)
@user = user
mail :to => @user.email, :subject => "Amusement.", :from => MAIL_ADDRESS
end
在這裏,我調用的方法send_mail_persons並通過了收件人信息作爲parameter.Also有一個簡單的方法..
def send_mail_persons
mail :to => MAILING_ADDRESS, :subject => "Amusement.", :from => MAIL_ADDRESS
end
和定義的常量都MAILING_ADDRESS和MAIL_ADDRESS。
感謝名單
2
最好的,你能找到的是瑞安的Railscast:
http://railscasts.com/episodes/206-action-mailer-in-rails-3
還不錯指南是在這裏:
http://guides.rubyonrails.org/action_mailer_basics.html
其實你可以不只是的ActionMailer而是整個Rails的廚房看有。
相關問題
- 1. ActionMailer不工作
- 2. Actionmailer BCC不工作
- 3. Heroku actionmailer如何
- 4. 如何的ActionMailer
- 5. Actionmailer如何在不定義設置的情況下工作?
- 6. 的ActionMailer不工作在軌2.3
- 7. ActionMailer Observer無法正常工作
- 8. Rails actionmailer,gmail工作,office 365不。
- 9. 如何測試ActionMailer?
- 10. 如何定義actionmailer主題
- 11. 如何獲得在的ActionMailer
- 12. ActionMailer - 如何添加附件?
- 13. ActionMailer的效率如何?
- 14. ActionMailer和延遲作業
- 15. ActionMailer:測試失敗,但在開發環境中工作
- 16. 爲什麼沒有:from參數在我的Rails actionmailer上工作?
- 17. ActionMailer中的動態主機無法正常工作
- 18. ActionMailer在終端中工作正常,不發送給gmail
- 19. ActionMailer FakeHttpContext
- 20. 如何爲Rails ActionMailer配置主機名?
- 21. 如何退出ActionMailer :: Base功能?
- 22. 如何設置Rails的優先級ActionMailer
- 23. 軌道4的ActionMailer - 如何使用deliver_later
- 24. 如何中止交付ActionMailer請求?
- 25. Rails:如何自行使用ActionMailer?
- 26. 如何在rails_admin中禁用ActionMailer?
- 27. Actionmailer - 我如何設置「from」部分?
- 28. 如何阻止郵件服務器/ actionmailer?
- 29. 如何配置ActionMailer使用的模板?
- 30. ActionMailer - 如何從s3添加附件
希望它能幫助,這是你問什麼... – Bijendra 2011-03-30 11:59:28
http://api.rubyonrails.org/ ..mailer是更好地在這裏解釋 – Bijendra 2011-03-30 12:02:04