Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # mailer test by ryan allen
- #
- # usage: ruby mailer.rb sender@blah.org recipient@blah.org
- #
- %w(rubygems actionmailer).each { |lib| require lib }
- ActionMailer::Base.delivery_method = :sendmail
- ActionMailer::Base.sendmail_settings[:arguments] = "-t -i -f #{ARGV[0]}"
- class TestMailer < ActionMailer::Base
- def test(from, to)
- puts "Delivering from #{from} to #{to}..."
- recipients to
- subject 'Testing Mailer'
- from from
- body "Hi #{to}, it's #{from}! Testing this mailer, it is #{Time.now}"
- end
- end
- TestMailer.deliver_test(ARGV[0], ARGV[1])
Add Comment
Please, Sign In to add comment