Last active
March 24, 2017 18:59
-
-
Save timhugh/69a28ba67d4cc7e6c220 to your computer and use it in GitHub Desktop.
sending mail through gmail using net/smtp
This file contains 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 'net/smtp' | |
msg = "Subject: Hi There!\n\nThis works, and this part is in the body." | |
smtp = Net::SMTP.new 'smtp.gmail.com', 587 | |
smtp.enable_starttls | |
smtp.start(your_domain, your_account_name, your_password, :login) do | |
smtp.send_message(msg, from_address, to_address) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment