Guest User

Untitled

a guest
Apr 19th, 2018
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #
  2. # mailer test by ryan allen
  3. #
  4. # usage: ruby mailer.rb sender@blah.org recipient@blah.org
  5. #
  6. %w(rubygems actionmailer).each { |lib| require lib }
  7.  
  8. ActionMailer::Base.delivery_method = :sendmail
  9. ActionMailer::Base.sendmail_settings[:arguments] = "-t -i -f #{ARGV[0]}"
  10.  
  11. class TestMailer < ActionMailer::Base
  12.  
  13. def test(from, to)
  14. puts "Delivering from #{from} to #{to}..."
  15. recipients to
  16. subject 'Testing Mailer'
  17. from from
  18. body "Hi #{to}, it's #{from}! Testing this mailer, it is #{Time.now}"
  19. end
  20.  
  21. end
  22.  
  23. TestMailer.deliver_test(ARGV[0], ARGV[1])
Add Comment
Please, Sign In to add comment