Rails action Mailer raise_delivery_errors, how does it work? How to detect bounces?

I have a Rails 4.2.0 application that sends a lot of emails, which means it pays.

I am currently having bounce problems, a lot of emails are bouncing back because the postal addresses are not valid.

One way is to fix the problem manually, starting by removing them from the database. But this is not suitable because there are about 10,000 registered users.

Now my assignment is

config.action_mailer.raise_delivery_errors = true 


exactly? What does it do? and how do I get an answer from this?

Did the method mail()

get a return value where I can see if the mail was sent or not?

And are there methods or guidelines for detecting with actionmailer if mail is delivered or not?


source to share

1 answer

If set false

, mail will silently capture and ignore any exceptions thrown when trying to deliver an email. Link .

In production, it is useful to set it to false

, because otherwise the failed email will throw an error for your end user.

In development, definitely set it to true


Take a look at this stone .

Among other functions, there is a method specifically for checking if there was mailbounced




All Articles