Action Mail Server plugin

Plugin details

ActionMailServer: A Ruby on Rails plugin that adds a simple SMTP server to test receiving emails easily.

Websitehttp://rubyforge.org/projects/railsmailserver/ Repositorysvn://rubyforge.org/var/svn/railsmailserver/plugins/actionmailserver Author Shinya Kasatani Tags mail, server LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install svn://rubyforge.org/var/svn/railsmailserver/plugins/actionmailserver

= Usage

1. Put this plugin into your vendor/plugin directory.
(./script/plugin install svn://rubyforge.org/var/svn/railsmailserver/plugins/actionmailserver)

2. Add following lines to config/environment.rb.

$mail_server = MailServer.new('127.0.0.1', 10025) do |server|
  server.filter_rcpt {|rcpt| rcpt =~ /@example\.com$/i }
  server.handle {|data| TheMailHandler.receive(data)}
end
# You should change following parts:
# '127.0.0.1' - IP address that the mail server will listen on.
# 10025 - Port number of the mail server.
# example\.com - The name of the domain you're receiving email.
# TheMailHandler - Subclass of ActionMailer::Base that has "receive" method to handle incoming email.



3. Start server with

./script/runner '$mail_server.start'


That's all.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 7 months ago