Created
December 13, 2011 08:54
-
-
Save ecylmz/1471290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'tlsmail' | |
| require 'time' | |
| from = "[email protected]" | |
| to = "[email protected]" | |
| p = "password" | |
| content = <<EOF | |
| From: #{from} | |
| To: #{to} | |
| subject: TEST from ruby | |
| Date: #{Time.now.rfc2822} | |
| Hello world! | |
| EOF | |
| Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) | |
| Net::SMTP.start('smtp.gmail.com', 587, 'gmail.com', from, p, :login) do |smtp| | |
| smtp.send_message(content, from, to) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment