我正在开发一个单页应用程序。
在应用程序的末尾,用户需要提交他的联系信息(姓名、电话号码等)。这将发送一封电子邮件并将页面修改为“感谢提交[...]”页面。
问题是,客户端可以按下“返回”按钮并重新发送电子邮件。
有没有方法来防止这种垃圾邮件?
在应用程序的末尾,用户需要提交他的联系信息(姓名、电话号码等)。这将发送一封电子邮件并将页面修改为“感谢提交[...]”页面。
问题是,客户端可以按下“返回”按钮并重新发送电子邮件。
有没有方法来防止这种垃圾邮件?
代码
Sub BT_Send(sender As Object, e As EventArgs) Handles BT_Send.Click
Try
'Creating the Email Message
Dim mailMessage As New MailMessage()
mailMessage.To.Add("SomeOne@a.com")
mailMessage.From = New MailAddress("Robot@a.com", "Robot")
mailMessage.Subject = "Test"
mailMessage.IsBodyHtml = True
mailMessage.Body = LBL_Emailbody.Text & _
"<br><br><br><div style=""font-size: 0.7em;"">Robot speaking, I will not answer if you send me a message.</div>"
Dim smtpClient As New SmtpClient("Something.com")
smtpClient.Send(mailMessage)
PNL_Before.Visible = False
PNL_After.Visible = True
Catch ex As Exception
LBL_errorEmail.Visible = True
'Should never happen...
End Try
End sub