Sending a Gmail message using the mail gem

#!/usr/bin/env ruby
 
require 'mail'
 
today = Time.now.strftime('%Y-%m-%d')
 
options = { :address              => "smtp.gmail.com",
            :port                 => 587,
            :domain               => '<your domain>',
            :user_name            => '<your full email>',
            :password             => '<your password>',
            :authentication       => 'plain',
            :enable_starttls_auto => true  }
 
Mail.defaults do
  delivery_method :smtp, options
end
 
Mail.deliver do
  to        '<your group email>'
  from      'Standup <<your group email>>'
  subject   "Standup #{today}"
  body      <<-EOM
This is the daily standup thread for #{today}. Please reply by the end of
the day with what you did Today, plan to do Tomorrow, and any Blockers you
are facing or questions you have for the group.
 
Thanks!
EOM
end

Copied from tpitale / standup_email[gist.github.com]

Tags:
Source:
2304hrs.txt
Published:
06-08-2013 23:04