The problem is how can I catch exception in delivering mail by ActionMailer. For me it sounds impossible, because in this case ActionMailer should sent mail to mailserver, and if mailserver returns error, ActionMailer should show me this error. I am interested only in counting undelivered mails.
Do you have any ideas how to implement this? Thanks!
I'm using something like this in the controller:
 if @user.save       begin       UserMailer.welcome_email(@user).deliver       flash[:success] = "#{@user.name} created"       rescue Net::SMTPAuthenticationError, Net::SMTPServerBusy, Net::SMTPSyntaxError, Net::SMTPFatalError, Net::SMTPUnknownError => e         flash[:success] = "Utente #{@user.name} creato. Problems sending mail"       end       redirect_to "/" 
                        This should work in any of your environment files. development.rb or production.rb
config.action_mailer.raise_delivery_errors = true
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With