Googled for this to no avail. Didn’t find anything in the API either. I was expecting some kind of class method or configuration option to set it…
So, rather than calling
from "my@email.com"
for every method, it could be called automatically.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Rails 3
config/environments/development.rb:
config/environments/production.rb:
You can also set this per mailer:
Rails 2
This is not supported by default. But you can achieve this functionality by using the action_mailer_callbacks plugin. Essentially this plugin allows you to add
beforeandafterfilters for thedelivermethod.Reference:
1) Article discussing the plugin.
OR
You can monkey patch the
frommethod ofActionMailer::Base.Add the code below to your
config\initializers\mail.rbNow you can configure your default value as follows:
config/environments/development.rb:
config/environments/production.rb:
You can also set this per mailer: