Created
March 29, 2014 23:48
-
-
Save kosaki/9864928 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 'mail' | |
| Mail.defaults do | |
| options = { :address => "smtp.gmail.com", | |
| :port => 587, | |
| :user_name => 'kosaki.motohiro', | |
| :password => 'パスワード', | |
| :authentication => 'plain', | |
| :enable_starttls_auto => true } | |
| delivery_method :smtp, options | |
| end | |
| mail = Mail.new do | |
| from 'kosaki.motohiro@gmail.com' | |
| to 'kosaki.motohiro@gmail.com' | |
| subject 'ruby mail test' | |
| body 'body' | |
| end | |
| #puts mail.to_s #=> "From: mikel@test.lindsaar.net\r\nTo: you@... | |
| mail.deliver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment