Class: MultiSMTP::Mail
- Inherits:
-
Mail::SMTP
- Object
- Mail::SMTP
- MultiSMTP::Mail
- Defined in:
- lib/multi_smtp/mail.rb
Instance Method Summary collapse
- #deliver!(mail) ⇒ Object
-
#initialize(default_settings) ⇒ Mail
constructor
A new instance of Mail.
Constructor Details
#initialize(default_settings) ⇒ Mail
Returns a new instance of Mail.
5 6 7 |
# File 'lib/multi_smtp/mail.rb', line 5 def initialize(default_settings) @default_settings = default_settings end |
Instance Method Details
#deliver!(mail) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/multi_smtp/mail.rb', line 9 def deliver!(mail) smtp_providers.each_with_index do |smtp_provider, index| self.settings = default_settings.merge(smtp_provider) begin super(mail) break rescue Exception => e next unless all_providers_failed?(index) if error_notifier error_notifier.notify(mail) else raise e end end end end |