I have a Rails 4.2.0 application which sends lots of mails, it's a elearning platfrom.
At the moment I have problems with bounces, Lots of the Mails coming back because the Mail-Adresses aren't valid.
One way is to solve the problem manually, starting deleting them from Database. But thats not suitable because there are about 10000 Users registered.
Now my questsion is what is
config.action_mailer.raise_delivery_errors = true
exactly? what does it do? and how do I get response from this?
Does the mail()
method got a return value where I can see If a mail was send or not?
And are there methods or best practices to detect with the actionmailer, if a mail is delivered or not?
Action Mailer allows you to send emails from your application using a mailer model and views. So, in Rails, emails are used by creating mailers that inherit from ActionMailer::Base and live in app/mailers. Those mailers have associated views that appear alongside controller views in app/views.
rails generates a mail preview if you use rails g mailer CustomMailer . You will get a file CustomMailerPreview inside spec/mailers/previews folder. Here you can write your method that will call the mailer and it'll generate a preview.
If set to false
, mail will silently catch and ignore any exceptions raised through attempting to deliver an email. Reference.
In production it is good to set it to false
, because otherwise failed email will throw an error to your end user.
In development definitely set it to true
.
Take a look at this gem.
Among other features there is a method specifically to check if mail was bounced
.
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