ActionMailler and Gmail (no plugins)

Last week I had some problems while trying to configure the ActionMailler with Gmail. I already have some applications in production mode recurring to this system, but this one, using ruby 1.8.7 and rails 2.3.3 gave me some trouble. Gmail requires TLS, older versions of ruby and rails do not support that, the work around was a pluging to enhance it(for example ActionMailerTLS). If you are using Ruby 1.8.7 and Rails 2.2.1, or later versions, you don't need any plugin, you only need to follow my instructions. Add the following lines in your config/enviroments/production.rb
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = YAML.load"#{RAILS_ROOT}/config/mailer.yml")
And then create the yaml file config/mailer.yml :
  :enable_starttls_auto: true # This is how you tell ActionMailler to use tls
  :port: 587
  :user_name: my_username #You should type your username, you should not include the "".
  :password: my_password #You should type your password
  :authentication: :plain
That's it! Now take a look in this notifier class example:
class Notifier < ActionMailer::Base
  def activation_instructions(user)
    @recipients  = "#{}"
    #@from        = "Miguel <>" # Doesn't work anymore 
    @from        = "" 
    @subject     = "[Card-Sorting] "
    @sent_on     =
    @subject    += "Important" 
    @body[:user] = user
There is a lack of backward compatible. Due to some changes in the latest versions you cannot use that syntax anymore, if you are upgrading from old versions be careful, you should only simply specify your email to get it correctly parsed.