views:

16

answers:

1

In ruby on rails 3 you can use their ActiveMailer for sending emails.

Also you can install the Mail gem.

I wonder what the difference is?

Does the Mail gem provide things ActiveMailer doesnt?

Should i always install this gem?

Thanks

+2  A: 

The relationship between the two is that the Mail gem is how Rails 3 implements mail ( replacing the previous TMail approach in earlier versions). In other words, ActionMailer is the Rails wrapper around the Mail gem's usage within the framework.

From a post by the gem's author:

The prior versions of ActionMailer used TMail for all its email delivery needs, and because certain functionality was missing in TMail (such as auto quoting and encoding of fields, handling multipart emails smoothly, etc.), ActionMailer had grown a set of fairly complex and fragile methods to shoehorn in the missing functionality.

That post is here. And this screencast might be helpful if you haven't seen it already.

bjg
But it seemed that i had to install the Mail gem to be able to use Mail class in the Rails console. Shouldn't it already be installed if Rails is using it through ActionMailer? The railscast showed us that we needed to install it too before we could use it.
never_had_a_name
@fayer. I would have thought so yes. That gem was automatically installed when I installed Rails 3 beta 4.
bjg