Mig*_*ing 16 email ruby-on-rails
有没有办法将rails 3中的电子邮件发送到本地文件左右,而不是使用SMTP服务器?我想在不使用任何类型的SMTP的情况下测试电子邮件的内容,理想情况下仅在DEV环境中.
最好的是本地SMTP或允许我检查电子邮件,检查电子邮件地址等的东西.
shi*_*ara 41
您可以使用:test system delivery
ActionMailer::Base.delivery_method = :test
Run Code Online (Sandbox Code Playgroud)
还有一个:文件delivery_method
ActionMailer::Base.delivery_method = :file
Run Code Online (Sandbox Code Playgroud)
您可以使用file_settings定义所有电子邮件的放置位置
ActionMailer::Base.file_settings = { :location => Rails.root.join('tmp/mail') }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7760 次 |
| 最近记录: |