Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. require 'mail'
  3.  
  4. def send
  5. #sendという名前の関数が定義されていると、mail.deliverの実行に失敗する...
  6. end
  7.  
  8. mail = Mail.new do
  9. from "yoggy0@gmail.com"
  10. to "yoggy0+test@gmail.com"
  11. subject "subject subject..."
  12. body "body body..."
  13. end
  14.  
  15. mail.delivery_method(:smtp,{
  16. :address => "smtp.gmail.com",
  17. :port => 587,
  18. :domain => "smtp.gmail.com",
  19. :user_name => "yoggy0@gmail.com",
  20. :password => "passwordpassword",
  21. :authentication => :plain,
  22. :enable_starttls_auto => true
  23. })
  24.  
  25. mail.deliver
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement