Net::SMTP for Gmail
$ gem install tlsmail
require "rubygems"
require "tlsmail"
require "time"
content = <<EOF
From: test.yu@gmail.com
To: test@test.com
Subject: TEST
Date: #{Time.now.rfc2822}
TEST CONTENT
EOF
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
Net::SMTP.start("smtp.gmail.com", "587", "localhost", "test.yu", "********", :plain) do |smtp|
smtp.send_message content, "test.yu@gmail.com", "test@test.com"
end
reference: http://d.hatena.ne.jp/zorio/
No comments :
Post a Comment