Topic: Hurry! Sending Email doesn't work on *Ubuntu*

Hi guys,

I am currently trying to use mailer to send email automatically in *Ubuntu* system. I followed the link tutorial:
http://www.youtube.com/watch?v=Jay__IhkN64

1. I created a mailer called UerEmails
2. Then In the file: [HOME]/app/mailers/user_mail.rb, I added a new function called signup_notify(email), the CODE is:
class UserEmail < ActionMailer::Base
  default :from => "from@example.com"
    def signup_notify(email)
        mail(:to => email, :subject => "Thanks!")
    end
end

3. I did smtp setting, say I created file [HOME]/config/initializers/smtp_settings.rb, the code inside is:

ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
    :tls => true,
    :enable_starttls_auto => true,
    :address => 'smtp.gmail.com',
    :port => 587,
    :domain => "gmail.com",
    :user_name => "myemail@gmail.com",
    :password => 'mypassword',
    :authentication => 'plain'
}

Then I went to rails console to try to call the function - singup_notify("test@gmail.com"), and then deliver the mail.
COMMAND is like this: UserEmail.signup_notify("test@gmail.com").deliver

There is the following exception raised:
TypeError: wrong argument (NilClass)! (Expected kind of OpenSSL::SSL::SSLContext)
    from /usr/lib/ruby/1.8/net/smtp.rb:577:in `initialize'
    from /usr/lib/ruby/1.8/net/smtp.rb:577:in `new'
    from /usr/lib/ruby/1.8/net/smtp.rb:577:in `original_tlsconnect'
    from /var/lib/gems/1.8/gems/mail-2.5.4/lib/mail/core_extensions/smtp.rb:14:in `tlsconnect'
    from /usr/lib/ruby/1.8/net/smtp.rb:553:in `do_start'
    from /usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
    from /var/lib/gems/1.8/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
    from /var/lib/gems/1.8/gems/mail-2.5.4/lib/mail/message.rb:2129:in `do_delivery'
    from /var/lib/gems/1.8/gems/mail-2.5.4/lib/mail/message.rb:232:in `deliver'
    from /var/lib/gems/1.8/gems/actionmailer-3.2.13/lib/action_mailer/base.rb:415:in `deliver_mail'
    from /var/lib/gems/1.8/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument'
    from /var/lib/gems/1.8/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /var/lib/gems/1.8/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in `instrument'
    from /var/lib/gems/1.8/gems/actionmailer-3.2.13/lib/action_mailer/base.rb:413:in `deliver_mail'
    from /var/lib/gems/1.8/gems/mail-2.5.4/lib/mail/message.rb:232:in `deliver'
    from (irb):1

As a result, the email wasn't sent successfully at all.

Anyone has any idea about how to solve it? Thanks in advance.