I am calling a method that will send an email via SMTP to the user to verify their account. I put this in a try catch block so that if it fails it will give the user an error message. However the time for it to time out is much longer than I would like. I would like to reduce the time for the method to fail to maybe 10 seconds so the user isn't waiting for something that is already going to fail.
Is there a way to shorten the wait time so that it falls into the catch faster?
try
{
SendVerificationLinkEmail(dbUser.Username, dbUser.ActivationCode.ToString());
}
catch
{
ViewBag.Message = "There was an error sending your verification email. Please try again later or contact Tech Support.";
return View("CreateAccount", new UserViewModel());
}