Created
December 8, 2014 23:23
-
-
Save ardian/53fd70818684976a186a to your computer and use it in GitHub Desktop.
Ruby code to send email
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 'mail' | |
options = { :address => "smtp.gmail.com", | |
:port => 587, | |
:domain => 'gmail.com', | |
:user_name => '[email protected]', | |
:password => 'password', | |
:authentication => 'plain', | |
:enable_starttls_auto => true } | |
Mail.defaults do | |
delivery_method :smtp, options | |
end | |
Mail.deliver do | |
to '[email protected]' | |
from '[email protected]' | |
subject 'testing sendmail' | |
body 'testing sendmail' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment