When I'm creating a user for my web application, an SMTP email (using ASP.NET's SmtpClient) is sent to the user with the automatically generated password. However, sometimes what I notice is that it times out and the new user simply won't receive the email with the password.
Alright, so I'll display a message indicating that the mail did not go through but the user is created.
Therefore, the sys admin has 2 options so far:
a) Reset the password for the user and hope another SMTP mail is sent with the auto-generated password. b) Delete and recreate the user.
I could rollback the user creation if the smtp is not sent but what is the best practice to tackle this problem?
I'm thinking that I should retry sending the email 3 times with a timeout period of 5 seconds each. So 15 seconds would be the worse case scenario.
Is this the way to go?