r38y / actionmailer-balancer

Allows you to configure multiple smtp accounts to send emails. Comes in handy with GAFYD's limit of 500 recipients.

This URL has Read+Write access

name age message
file MIT-LICENSE Loading commit data...
file README
file Rakefile
file init.rb
directory lib/
directory test/
README
ActionMailer Balancer
====================

ActionMailer Balancer allows you configure multiple SMTP user accounts to send email from. This comes in handy with 
Google Apps which limits you
to 500 recipients/day. 

Example
=======

in environment.rb:

config.action_mailer.smtp_settings = {
  :address => "smtp.gmail.com",
  :port => "587",
  :domain => "test.com",
  :authentication => :plain,
  :user_name => "no-reply1@test.com",
  :password => "password"
}

It is probably a good idea to have a default user_name and password. To configure the list of accounts you want to send 
mail from, add something
like the following to an initializer:

ActionMailer::Base.smtp_users = [
  { 
    :user_name => "no-reply1@test.com",
    :password => "password"
  },
  { 
    :user_name => "no-reply2@test.com",
    :password => "password"
  }
]

You can add as many sets of credentials as you want and it will pick one at random every time an email is 
created/delivered.

ENJOY!

Copyright (c) 2008 Randy Schmidt, released under the MIT license