예제 #1
0
        private static bool SendRecoverEmail(UserInfo user, string location, bool isTest)
        {
            try
            {
                StringBuilder builder = new StringBuilder();

                builder.Append("Hello, we have received your message that your password has been forgotten.  To reset your password please click the link below.<br />");
                builder.Append(@"http://localhost:61860/" + location + "/CompeRec/" + user.RecoverCode);

                IEmailTools emailTools = AppTools.InitEmailTools(isTest);
                if (emailTools.SendEmail(user.Email, builder.ToString()) == false)
                {
                    throw new Exception("Error sending email.");
                }

                return(true);
            }
            catch (Exception ex)
            {
                DBCommands.RecordError(ex);
                return(false);
            }
        }