Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.
Kenneth Kalmer edited this page May 7, 2011 · 2 revisions

Exception email support is provided by the Mail gem.

Dependencies

To use the Mail strategy you need to install (or bundle) the Mail gem, and configure the Mail strategy.

In your Gemfile:

  gem "mail"

Configuration

The Mail strategy itself only has three configuration settings, the rest are handled by configuring the Mail gem.

Configuring the Mail strategy is as simple as this:

  # Set the recipient of the exception emails (required)
  Safely::Strategy::Mail.recipient = "[email protected]"

  # Set the sender (optional)
  Safely::Strategy::Mail.sender = "safely@hostname"

  # Subject prefix (optional)
  Safely::Strategy::Mail.subject_prefix = "[SAFELY]"

By default the Mail gem will deliver mail over SMTP to localhost on port 25. This and all other behaviors of the Mail gem can be configured using something like this:

  Mail.defaults do
    delivery_method :sendmail
  end

For more information, see the [[Mail documentation|http://rdoc.info/gems/mail/frames]].

Clone this wiki locally