aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r--actionmailer/lib/action_mailer/base.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index a8233512ab..356861b591 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -524,14 +524,16 @@ module ActionMailer #:nodoc:
def deliver!(mail = @mail)
raise "no mail object available for delivery!" unless mail
- begin
- ActiveSupport::Notifications.instrument("action_mailer.deliver",
- :template => template, :mailer => self.class.name) do |payload|
- self.class.set_payload_for_mail(payload, mail)
+ ActiveSupport::Notifications.instrument("action_mailer.deliver",
+ :template => template, :mailer => self.class.name) do |payload|
+
+ self.class.set_payload_for_mail(payload, mail)
+
+ begin
self.delivery_method.perform_delivery(mail) if perform_deliveries
+ rescue Exception => e # Net::SMTP errors or sendmail pipe errors
+ raise e if raise_delivery_errors
end
- rescue Exception => e # Net::SMTP errors or sendmail pipe errors
- raise e if raise_delivery_errors
end
mail