views:

11

answers:

1

I have a rails app that needs to send out thank you emails to customers. I also need to have it so that there is a generic template that the user can edit before sending it off. I know I can do something like this with ActionMailer, but what I need to do is have it so that each user of the app can have a different email to send out of.

For example, if user "bob" needs to send an email, I would like to send the email from [email protected]. All of the SMTP settings will be the same (smtp.example.com) and the password for the smtp server should be user set.

I read about a rails hack that would allow different email senders for ActionMailer, but it required that each sending email had its own model. This won't really work because I'll need the ability to add new users on the fly, and I'll start with about 250 different users.

I don't care how this is done, it could be in rails, but if there is another solution that uses language X, then I'm fine with that too. But how would I create a generic emailer that would use different email accounts from the same host to directly send out the thank you cards?

A: 

It's pretty low-level stuff but you might want to look into using Net::SMTP directly. It should allow you to do whatever you need if you're willing to get your hands dirty and send email like Rails was never invented.

aNoble