Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'pony'
- class Mailer
- smtp_user = 'listingnote+virtualrealestateshop.com'
- smtp_password = 'vN9wN8lktEmH'
- smtp_host = 'mail.virtualrealestateshop.com'
- smtp_port = '26'
- smtp_auth = :plain
- # takes an array of recipient address, from string, subject string, body string
- def send(options={})
- #raise(ArgumentError, "missing a required mail option") unless options.length == 4
- Pony.mail(
- :to => options[:to].join(','),
- :from => options[:from],
- :subject => options[:subject],
- :body => options[:body],
- :via => :smtp,
- :smtp => {
- :user => smtp_user,
- :password => smtp_password,
- :host => smtp_host,
- :port => smtp_port,
- :auth => smtp_auth
- })
- end
- end
- Mailer::send({
- :to => ['alan.dipert@gmail.com'],
- :from => 'yourmom@wtf.net',
- :subject => 'this is a subject',
- :body => 'this is a body'
- })
Add Comment
Please, Sign In to add comment