I have an aspx page that send an email to the user, and until now it worked, but now I receive an error. This is the sub and the error:
Code:Sub send_Password(Sender As Object, E As ImageClickEventArgs) If (Page.IsValid) Then Dim CmdPassword As New SqlCommand("return_Password", strConnection) CmdPassword.CommandType = CommandType.StoredProcedure CmdPassword.Parameters.Add(New SqlParameter("@e_mail", SqlDbType.varchar, 50, "e_mail")) CmdPassword.Parameters("@e_mail").Value = mail.Text() CmdPassword.Parameters.Add("@Resp", SqlDbType.TinyInt) CmdPassword.Parameters("@Resp").Direction = ParameterDirection.Output CmdPassword.Parameters.Add("@Password", SqlDbType.varchar, 8) CmdPassword.Parameters("@Password").Direction = ParameterDirection.Output strConnection.open() CmdPassword.ExecuteNonQuery Dim Response As byte = CmdPassword.Parameters("@Resp").Value strConnection.close() If (Resonse = 1) Then Dim E_mail As New MailMessage() E_mail.To = mail.Text() E_mail.From = """Cesar"" <[email protected]>" E_mail.Subject = "Access Data - MySite.com" E_mail.Body = "Your access code is: " & CmdPassword.Parameters("@Password").Value E_mail.Priority = MailPriority.Normal try SmtpMail.SmtpServer = "mail.infomail.es" SmtpMail.Send(E_mail) Response.Redirect("forgotten_code_ok.aspx") catch exc as Exception Message.Text() = "An error happened." End Try Else Message2.Text() = "None user was found with these credentials." End If End If End Sub
And the server error message:
The XML file c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config could not be loaded. Attempted to access an unloaded AppDomain.
Source Error: [No relevant source lines]
How can I solve it?
Thanks


Reply With Quote