我有以下代码打开一个页面并向在课堂会话中注册的学生发送电子邮件,并附上他们的证书,生成电子邮件和证书都在不同的 aspx 页面中工作。现在,我想生成相同的流程,而不需要用户等到所有电子邮件都发送完毕,如果有任何问题,我会在流程中添加额外的代码来通知我。谁能指出我实现这一目标的正确方向。我已经阅读了几个论坛,但大多数情况下我发现 Windows 服务是一种选择,IMO 有点过分了。我很感激任何建议
先谢谢了,
担
Protected Sub lbEmailOLetter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbEmailOLetter.Click
Dim id As Integer
id = hfSessionID.Value
If id > 0 Then
Try
HttpContext.Current.Server.Execute("Email.aspx?SessID=" & id, False)
HttpContext.Current.ApplicationInstance.CompleteRequest()
Catch ex As Exception
lMessage.Text = "Could not send email with attachment."
End Try
Else
lMessage.Text = "Must create and save a session in order send letter by email."
End If
End Sub