Posted on: 8/1/2013 6:22:28 AM | Views : 606

I inherited a project that gives users the above error while trying to change their password. I stepped through and found the trouble spot, but the problem is, the values generated seem right so I don't why the error is occurring. Thanks in advance to anyone who can look at the following code and help me find out how to fix it. Let me know if more information is needed.
void EmailUser(User user) { user.ChangePasswordID = Guid.NewGuid(); user.Save(); MailMessage email = new MailMessage(); //problem line below email.From = new MailAddress(Settings.LostPasswordEmailFrom); email.To.Add(new MailAddress(uxEmail.Text)); email.Subject = Settings.LostPasswordSubject; email.Body = EmailTemplateService.HtmlMessageBody(EmailTemplates.MembershipPasswordRecovery, new { Body = Settings.LostPasswordText, BeginRequired = "", EndRequired = "", UserName = user.Name, GUID = user.ChangePasswordID.ToString() }) ...

Go to the complete details ...