Created
November 9, 2008 19:49
-
-
Save methodmissing/23332 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Delivers a TMail::Mail object. By default, it delivers the cached mail | |
| # object (from the <tt>create!</tt> method). If no cached mail object exists, and | |
| # no alternate has been given as the parameter, this will fail. | |
| def deliver!(mail = @mail) | |
| raise "no mail object available for delivery!" unless mail | |
| unless logger.nil? | |
| logger.info "Sent mail to #{Array(recipients).join(', ')}" | |
| logger.debug "\n#{mail.encoded}" | |
| end | |
| begin | |
| __send__("perform_delivery_#{delivery_method}", mail) if perform_deliveries | |
| rescue Exception => e # Net::SMTP errors or sendmail pipe errors | |
| raise e if raise_delivery_errors | |
| end | |
| return mail | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment