I want to add this feature to my application. It works OK but I'm afraid of a problem here. At first, I'll talk a little about how I implement the feature. Simply, the user has to register his email address first (at the registration time). If he loses his password, he can click on a link to activate the sender. This sender will send the password (corresponding to his username) to his registered email address. I think there should have many kinds of sender here and I'm using SmtpClient to send the email. This Smtp needs a NetworkCredential, and I provide it with some valid and active Credential. I have to create some user accounts (in Gmail and Yahoo networks), apply these accounts information as the credentials for my Smtp.
Here is the problem, my Password restoring feature won't work if all those credentials being invalid or inactive. I mean if all the user accounts (I created in Gmail and Yahoo mail) somehow are inactive, the Smtp will be unable to send the email. The most popular reason for those accounts being inactive is there hasn't been any access/login to them for a long time (e.g: about 3 months). It is almost certain that it will happen, except I have to remind myself to login to those accounts periodically to keep them active.
I wonder if there is any solution for this? I've thought of keeping those accounts information in a config file but the customer won't know how to edit that config file to change the sender credential information and even they know how to, that's so inconvenient. I've also thought of popping up a window requiring information for the sender credential from user (user may use his own email account or has to create a new one), it's also inconvenient, I think so. I've also think of logging to those accounts (via my application) periodically (about once a month) to keep them active. But I wonder if there is a better solution, plus that requires the user computer to be connected to Internet and this is not always met (even there is a situation that the user computer is always off line for months or years, but suddenly one day, he loses his password, he wants to get it back and at that time, he connects his computer to the Internet and uses the password restoring feature, but he can't because all the accounts built-in for the sender credentials has been inactive because of not having any access/login to them for months/years).
Do you have any idea on how to solve this problem?