I want to send myself email of exceptions that are caught in my app when it is "in the wild."
I found a simple way to accomplish the programmatic sending of email using K.R.R.'s answer here, but it requires the adding of credentials like so:
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("neversaynunca@gmail.com", "cuddlyPlatypi");
Is there a way I can do this without revealing my password this way (I know that code can be rather easily snooped into to find such)?
It depends upon the level of hacking you are expecting. If you are not delivering source code then the easiest way is to encrypt your account and password using your own encryption algo from your computer, then only decrypt in your app. It is not super safe but the question is do you think that someone will go through the byte code to figure out your app? Example:
SmtpServer.Credentials = new System.Net.NetworkCredential(decrypt("asdf42das24dfsf44sdfa4fg"), decrypt("gjlkdivn3qefdasd48adjvjv4385939"));