adding the minimalist version of mailer (using third party smtp-tls lib)
This commit is contained in:
parent
15f962eec0
commit
4364327d94
18
cookbook/014/05-minimalist.rb
Normal file
18
cookbook/014/05-minimalist.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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
|
Loading…
Reference in New Issue
Block a user