Skip to content

Instantly share code, notes, and snippets.

@yoggy
Created September 1, 2015 11:11
Show Gist options
  • Save yoggy/ed5dc8f066c02da14785 to your computer and use it in GitHub Desktop.
Save yoggy/ed5dc8f066c02da14785 to your computer and use it in GitHub Desktop.
Rubyのmailライブラリではまったこと ~ sendという名前の関数が定義されていると、mail.deliverの実行に失敗する...
#!/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