Created
September 1, 2015 11:11
-
-
Save yoggy/ed5dc8f066c02da14785 to your computer and use it in GitHub Desktop.
Rubyのmailライブラリではまったこと ~ sendという名前の関数が定義されていると、mail.deliverの実行に失敗する...
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
#!/usr/bin/ruby | |
require 'mail' | |
def send | |
#sendという名前の関数が定義されていると、mail.deliverの実行に失敗する... | |
end | |
mail = Mail.new do | |
from "[email protected]" | |
to "[email protected]" | |
subject "subject subject..." | |
body "body body..." | |
end | |
mail.delivery_method(:smtp,{ | |
:address => "smtp.gmail.com", | |
:port => 587, | |
:domain => "smtp.gmail.com", | |
:user_name => "[email protected]", | |
:password => "passwordpassword", | |
:authentication => :plain, | |
:enable_starttls_auto => true | |
}) | |
mail.deliver |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment