2008-09-25
  1. Setup your ActionMailer. I’m using Google Mail for my stuff: http://www.rubyinside.com/how-to-use-gmails-smtp-server-with-rails-394.html
  2. ruby script/generate mailer testmailer
  3. Add this code to testmailer.rb (Testmailer < ActionMailer::Base)
    def test_mail(to)
    subject "My first email!"
    recipients "#{to}"
    from 'test'
    charset "utf-8"
    content_type 'text/html'
    body "Testing one two three..."
    end
  4. ruby script/console
  5. Testmailer.deliver_test_mail("you@yourdomain.com")

ActionMailer API doc

One Response to “How to send test mail with ActionMailer”

  1. Josh Says:

    Just an FYI, Rails 2.3 has native TLS support built in.

Leave a Reply


I've left the country and this site is just an archive! Check out my trip blog!