Recently I ran into a problem where I needed to be able to send emails via two different SMTP accounts within the same Rails application. I scoured the net trying to find a method to do this, but I couldn't find one. So I pulled out my hack-hat and got started.
If there are any better ways to do this, I would love to hear about it.
I first created a new YAML file in my config folder called action_mailer.yml. In this file, I specified three different nodes with the actionmailer settings.
Afterwards, I created two mailer models that represent each of the different mailers I will use.
So now when I send an email, I can first determine which mailer to use and then send the email.
For example, your controller might have code that looks like this:
I realize this is probably the hard way, but hey, it's a start. Please post any plugins or alternatives to doing this if you know of any.