It is easy to send emails using MonoRail combining templates as you do with the views. Layouts are not applied to e-mail templates, though.
The most manual way to send an email is to configure a
Castle.Components.Common.EmailSender.Message instance and invoke
DeliverEmail which is exposed by the
A better way is to externalize the configuration of the
Message. You can do that by creating view templates on the
mail folder under your
views directory. You can even add headers like
subject to the template. They will be used to properly set up the
Message instance. The rest of the view template will be considered the e-mail body. If the body starts with an
tag, the Message format will be changed to
RenderMailMessage can be used to create a configured
Message instance based on the specified template. It gives you a chance to modify the message before sending it with
RenderEmailAndSend is a combination of the methods above. It creates the
Message instance and sends it.