Responses

ActionMailer Examples: Responses, Welcome Greetings, Sendmail, Templating and Performance

Using Rails ActionMailer The Right Way

By providing the full name in the @from field, you avoid having emails say they were sent from congratulations:

def new_registration(user)
@subject = ‘Welcome!’
@recipients = user.email
@from = ‘Ruby on Rails Blog <congratutions@domain.com>’
@body[”user”] = user
end

Now the email will show that it’s from Ruby an Rails Blog. This passed some simple tests with yahoo and gmail with no messages being sent to the spam folder. Everything comes through perfectly.