SMTP Patch
Enhance Ruby net/smtp library to support never interrupted by errors while mail sending to multiple receptions.
Installation
Add the gem to your Gemfile:
gem 'smtp-patch'
Install the gem with bundler:
bundle install
Usage
By default, the mail will always be sent when you are sending a mail to multiple receiptions. However, during the sending, if there are errors happened, the errors will not raise at once but raise after email sent out. You can catch the errors like below:
begin
Mailer.test.deliver_now!
rescue => e
puts e.class #=> Net::SMTPErrors
puts e. #=> failed to deliver for {"[email protected]"=>#<Net::SMTPFatalError: 554 RCPT ([email protected]) dosn't exist>}.
puts e.errors #=> { "[email protected]" => #<Net::SMTPFatalError: 554 RCPT ([email protected]) dosn't exist> }
end
License
Released under the MIT license. See LICENSE file for details.