box-o-sand/RubyFun/cookbook/014/05-minimalist.rb
Dan Buch 0a9428093c Add 'RubyFun/' from commit 'b01c6826131196ba58b5288a3182f2526c89c249'
git-subtree-dir: RubyFun
git-subtree-mainline: a04a502787
git-subtree-split: b01c682613
2013-01-09 23:50:14 -05:00

19 lines
414 B
Ruby

require 'rubygems'
require 'net/smtp'
require 'smtp-tls'
body = <<EOM
To: daniel.buch+rubytest@gmail.com
From: daniel.buch@gmail.com
Subject: minimalist message
AHOY
EOM
Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com',
'daniel.buch@gmail.com', STDIN.readline, :login) do |smtp|
smtp.send_message(body, 'daniel.buch@gmail.com',
'daniel.buch+rubytest@gmail.com')
end