How to catch error exception in ActionMailer
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