Guest User

Untitled

a guest
Mar 7th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. require 'rubygems'
  2. require 'pony'
  3.  
  4. class Mailer
  5.  
  6. smtp_user = 'listingnote+virtualrealestateshop.com'
  7. smtp_password = 'vN9wN8lktEmH'
  8. smtp_host = 'mail.virtualrealestateshop.com'
  9. smtp_port = '26'
  10. smtp_auth = :plain
  11.  
  12. # takes an array of recipient address, from string, subject string, body string
  13. def send(options={})
  14. #raise(ArgumentError, "missing a required mail option") unless options.length == 4
  15. Pony.mail(
  16. :to => options[:to].join(','),
  17. :from => options[:from],
  18. :subject => options[:subject],
  19. :body => options[:body],
  20. :via => :smtp,
  21. :smtp => {
  22. :user => smtp_user,
  23. :password => smtp_password,
  24. :host => smtp_host,
  25. :port => smtp_port,
  26. :auth => smtp_auth
  27. })
  28. end
  29. end
  30.  
  31. Mailer::send({
  32. :to => ['alan.dipert@gmail.com'],
  33. :from => 'yourmom@wtf.net',
  34. :subject => 'this is a subject',
  35. :body => 'this is a body'
  36. })
Add Comment
Please, Sign In to add comment