smtp mail example in Ruby


SUBMITTED BY: Guest

DATE: May 21, 2015, 10:13 a.m.

FORMAT: Ruby

SIZE: 757 Bytes

HITS: 686

  1. require 'mail'
  2. #
  3. # You can use mandrillapp.com as smtp server, if you don't have one.
  4. #
  5. Mail.defaults do
  6. delivery_method :smtp, { :address => "smtp address",
  7. :port => port,
  8. :domain => 'domain',
  9. :user_name => 'username',
  10. :password => 'password',
  11. :authentication => nil,
  12. :enable_starttls_auto => true }
  13. end
  14. Mail.deliver do
  15. to "example@IMPORTANT.bot"
  16. from "IMPORTANT@example.bot"
  17. subject "just a test :D"
  18. body "just a test :D"
  19. end

comments powered by Disqus