Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Tool for sending fast mailings
branch: master
Failed to load latest commit information.
lib Bump version to 0.9.4
test Fix from field encoding issues
.gitignore Init
Gemfile Init
LICENSE Init Sending speed: docs and refactoring
Rakefile Auto testing
mailing.gemspec Sending speed: docs and refactoring


Tool for sending fast mailings in one SMTP connection.


Add this line to your application's Gemfile:

gem 'mailing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mailing

Sending speed

Default sending speed is low and set to ~ 120 mails per minute. You can change that value by setting the delay parameter in sender.

Step by step usage

require 'mailing'
require 'logger'

# create channel
config = {
  :address => 'localhost',
  :port    => 25,
  :domain  => 'localhost.localdomain'
channel =

# create sender with channel, envelope_from and logger
logger ='/tmp/mailing.log')
sender =, '', logger)
sender.delay = 0.1 # ~ 600 mails per minute

# create mailing with from, subject, body, recipients
mailing ='', 'Subject', 'Body')
mailing.recipients = %w(

# send mailing

Quick usage

require 'mailing'
require 'logger'

mailing ='', 'Subject', 'Body')
mailing.recipients = %w(
config = {
  :address => 'localhost',
  :port    => 25,
  :domain  => 'localhost.localdomain'
# send with config and envelope_from set to
# without logging and with 0.2 delay (~ 300 mails per minute)
mailing.send_by_smtp(config, '', nil, 0.2)

Rails usage

mailing ='', 'Subject', 'Body')
mailing.recipients = User.pluck(:email)
                     '', Rails.logger)


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.