You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 22, 2024. It is now read-only.
James McKinney edited this page Jul 5, 2013
·
2 revisions
Turn mail delivery on or off
message=Mail.newdofrom'foo@example.com'to'bar@example.com'subject'test'body'hello'end# Turn off mail delivery (on by default).message.perform_deliveries=false# The message will not be sent.message.deliver
classMailLoggerdefdeliver_mail(mail)# Perform logging, or whatever else you want to do.putsmail.inspect# Deliver the message as usual.yieldendendlogger=MailLogger.newmessage=Mail.newdofrom'foo@example.com'to'bar@example.com'subject'test'body'hello'end# Set a custom handler for mail delivery.message.delivery_handler=logger# The message will be logged and sent.message.deliver