I am trying to send email whenever there is an exception in my code using Elmah. Here is the configuration in web.config file.
<elmah>
<errorMail from="[email protected]" to="[email protected]"
async="true" smtpPort="0" useSsl="true" />
</elmah>
<system.net>
<mailSettings>
<smtp deliveryMethod ="Network">
<network host="smtp.gmail.com" port="587" userName="[email protected]" password="MyEmailPassword" />
</smtp>
</mailSettings>
</system.net>
Now above configuration works fine. I tested in localhost every time I get an exception I am getting an Email Successfully.
Question 1:
Does that mean if I deploy my application with above settings, no matter who ever access my website, if they get an exception I will receive an email.
Question 2:
I have added password in above config file. But now everyone can see my password. Is this the right way or I can still send the mail w/o putting my password in config file.