views:

12

answers:

1

Is there any way to send emails in rails 3 to a local file or so, instead of using an SMTP server? I'd like to test the email's contents without using any kind of SMTP, ideally only in DEV environment.

The best would be a local SMTP or something that allowed me to inspect emails, check email addresses, etc.

+2  A: 

You can use the :test system delivery

ActionMailer::Base.delivery_method = :test

There are also a :file delivery_method

ActionMailer::Base.delivery_method = :file

You can define where put all email with file_settings

ActionMailer::Base.file_settings = { :location => Rails.root.join('tmp/mail') }
shingara
Thanks, that's exactly what I want.
Miguel Ping