I have an application that will send authenticated emails using System.Net.Mail and System.Net.NetworkCredential. The question is, how do I store the password needed to create the NetworkCrednetial object?
There is no login in the application, but I can configure a parameter that allows the user to enter their email credentials (in almost all cases this will be their Windows login). I cannot use Active Directory because not every client uses it.
I can get the password from the user, and then save it in the user registry, file or database. Obviously, I will have to encrypt it. I'm not very good at encryption, so some pointers will be appreciated if people think this is the best mechanism.
My preference would be to avoid having to store anything, so anyway I can get around to store the credentials myself, maybe I can get it from the current login or somewhere else?
Michael Prewecki
source share