Many applications need to send email. Merb Mailers allow you to do this easily with the same controller and view conventions the rest of your application follows. The
Mailer class is thus a subclass of
AbstractController, and the relevant templates are standardly placed in
app/mailers/views. In this chapter we’ll configure, generate, describe, and test mailers used in Merb applications.
If you don’t configure Merb otherwise, it tries to use SMTP locally when asked to deliver mail. In most cases these exact defaults do not suffice, but alternative configurations are as simple as a few extra lines in either
config/init.rb or one of the environment config files in a
before_app_loads block. Below we describe ...