Hi,I am using Thread in Global.asax file to send email.I have created a table tblNotification - ReceiverEmail,subject,body,pendingMail (false/true)Also I created a function SendNotification in Global.asax file.Now when user clicks Submit button, it should send en email reading the SendNotification() using Thread in background to avoid waiting to the user.On Submit click button, i store user details in tblNotification table and set pendingMail = false. Now in Global.asax file, on Application_BeginRequest(), i create a thread and call SendNotification() in ThreadStart. In SendNotification(), i change status of pendingMail = true after it sends mail.It sends email successfully and also user does''nt have to wait for long. But it sends 45 emails to the user with same content.Is is due to Thread not aborted? or am i creating the thread in wrong event? Regards,Sneha 解决方案 这篇关于在全局asax文件中发送电子邮件的线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
11-03 01:51