Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 68b7d6e011
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (40 sloc) 1.551 kB
= simple_mailer
simple_mailer is a very simple email library for ruby, with testing
support. It just uses ruby's standard net/smtp library to send out
the emails. Configuration is limited to setting the server that
the email is sent to (defaults to localhost). Testing support is
limited to appending the emails that would have been sent to an
simple_mailer can be installed with:
sudo gem install simple_mailer
Source is available at github:
== Usage
There is no required configuration, you can use simple_mailer
require 'simple_mailer'
SimpleMailer.send_email('', '', 'Subject',
'Body', 'HeaderKey'=>'HeaderValue')
Or, you can include the SimpleMailer module in other classes:
class Mailer
include SimpleMailer
def initialize(subject, body)
@subject = subject
@body = body
self.smtp_server = ''
def email(from, to)
send_email(from, to, @subject, @body)
end'Subject', 'Body').email('', '')
== Testing
Testing support is probably the main reason to use simple_mailer over
using net/smtp directly. After you enter test mode, emails you send
are available via the emails_sent option:
SimpleMailer.emails_sent # []
SimpleMailer.send_email('', '', 'S', 'B')
SimpleMailer.emails_sent # [[message, '', '']]
== Author
Jeremy Evans (
Jump to Line
Something went wrong with that request. Please try again.