Configure Elmah email settings in the code, not in the config

I am setting up Elmah emails and I do not want to provide email credentials in web.config.

I am deploying to Azure and therefore would like to find the credentials from the settings of the Azure application in the code when the application starts.

Is there a way to set up Elmah email declaratively in code, rather than using the <errorMail> tag?

0
source share
2 answers

The best way to do this is to override the SendMailElmah method ErrorMailModuleproposed by Atif Aziz in this discussion on Google groups.

I gave more details in this answer .

+1

Source: https://habr.com/ru/post/1654040/


All Articles