Difference in ActionMailer between rails 2 and rails 3

Rails 2

def welcome(user)
    @recipients = “#{user.email}”
    @from = “admin@samplesite.com”
    @subject = “Welcome Mail”
    @body[:user] = user

Rails 3

def welcome(user)
    @user = user
    mail(:from=>”admin@samplesite.com”, :to=>”#{user.email}”, :subject=>”Welcome Mail”)

We can also set the default value if it is common for all the methods. For ex, consider ‘from’ address is common for all the mail notifications. If so, we can set the default ‘from’ address commonly before the methods, in this case no need to set ‘from’ address in each and every method separately.

default :from => “admin@samplesite.com”