Hi there,
I am using .net Framework 1.1. I am trying to send email using
vb.net(ASP.net). Using the web.mail namespace, which sends the mail fine. The problem is even though the mail gets sent, I get an error "Thread was being aborted" which means if I try email in a try...catch statement some of my code after the email code does not execute.
What is causing this error? I've tried everywhere and can't seem to find the answer, please help!
Copy of code
Try
'This works fine
objEmail = New MailMessage
objEmail.To = ConfigurationSettings.AppSettings("adminEMail")
objEmail.Priority = MailPriority.Normal
objEmail.Subject = Subject
objEmail.BodyFormat = MailFormat.Html
objEmail.Body = Message
objEmail.From = ConfigurationSettings.AppSettings("adminEMail")
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("eMailServer")
SmtpMail.Send(objEmail)
'Exception gets thrown when try to send mail
'Any code I put here will not execute because of exception being thrown
Catch ex1 as exception
'This is where I catch the "Thread was...." error
end try