Below is an example script for sending mail to someone via the Mail gem. The mail gem tends to be easier to user than the built in SMTP library included with Ruby. In this example we use gmail and hence, the host and port are set up for gmail, but you can change the host/port to anything.

require 'mail'

options = { :address              => "",
            :port                 => 587,
            :domain               => '',
            :user_name            => 'your username',
            :password             => 'your password',
            :authentication       => 'plain',
            :enable_starttls_auto => true  }

Mail.defaults do
  delivery_method :smtp, options

Mail.deliver do
       to '[email protected]'
     from '[email protected]'
  subject 'test email'
     body 'This is a test.'