Skip to content

Instantly share code, notes, and snippets.

@phillipkoebbe
Created March 5, 2010 02:07
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save phillipkoebbe/322378 to your computer and use it in GitHub Desktop.
# config/environments/development.rb
# add this line
config.action_mailer.delivery_method = :test
# app/models/my_mailer.rb
class MyMailer < ActionMailer::Base
def test_message(content)
recipients 'test_user@example.com'
from 'another_user@example.com'
subject 'Test Message'
body content
end
end
# app/controllers/test_controller.rb
class TestController < ApplicationController
def send_mail
MyMailer.deliver_test_message('Hi There.')
render :nothing => true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment