How to tell user the mailer SMTPAuthenticationError via another mail if the settings is failed?

Can anyone tell how to do this in ruby on rails.

How to tell user the mailer SMTPAuthenticationError via another mail if the settings is failed?

You could in theory rescue the error, but if your mail system is not working, how do you send a mail to say it is not working!

Ideally your application will send mails via its own user account, and therefore you can test the auth before deploying