Utopia SourceUtopiaExceptionsMailer

class Mailer

A middleware which catches all exceptions raised from the app it wraps and sends a useful email with the exception, stacktrace, and contents of the environment.

Definitions

LOCAL_SMTP = [...]

A basic local non-authenticated SMTP server.

Implementation

LOCAL_SMTP = [:smtp, {
	:address => "localhost",
	:port => 25,
	:enable_starttls_auto => false
}]

def initialize(app, to: "postmaster", from: DEFAULT_FROM, subject: DEFAULT_SUBJECT, delivery_method: LOCAL_SMTP, dump_environment: false)

Implementation

def initialize(app, to: "postmaster", from: DEFAULT_FROM, subject: DEFAULT_SUBJECT, delivery_method: LOCAL_SMTP, dump_environment: false)
	@app = app
	
	@to = to
	@from = from
	@subject = subject
	@delivery_method = delivery_method
	@dump_environment = dump_environment
end