Hello All,
I am trying to send an email everytime a page loads.
This is my code
Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
Dim message = New MailMessage()
message.From = New MailAddress("noreply@doman.com")
message.To.Add(New MailAddress("user@domain.com"))
message.Subject = "This is my subject"
message.Body = "This is the content"
Dim client As New SmtpClient()
client.Send(message)
End Sub
This works for sending the email, but if the Page stays open, it keeps sending the Email until i close the page...
How can i get it to send only ONCE when the page is loaded
Thanks in advance