I have a submit button which fires when the page is first loaded.
the is vb.net code behind page, asp.net 2.0.
any ideas?
DougP
< I Built one
the is vb.net code behind page, asp.net 2.0.
Code:
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
'If Not Page.IsPostBack Then
Dim CrLf As String = Chr(13) & Chr(10)
'save to database
'send email to them saying this is subject to approval
Dim EmailSubject, EmailBody As String
EmailSubject = "Thank you for submitting your request to Robots2000"
EmailBody = "Please allow 36hrs for completion of your request for R2-D2 to show up..." & CrLf
EmailBody = EmailBody & " at the " & DropDownList1.Text & " located at " & txtLocation.Text & CrLf
EmailBody = EmailBody & "" & CrLf
EmailBody = EmailBody & "You will be notified by an email sent to " & txtEmail.Text & " if you're request has been approved." & CrLf
EmailBody = EmailBody & "" & CrLf
EmailBody = EmailBody & "Please contact us Immediately if there is a Cancellation!"
Try
Dim message As New MailMessage("r2d2@robots2000.com", txtEmail.Text, EmailSubject, EmailBody)
Dim emailClient As New SmtpClient("localhost")
emailClient.Send(message)
lblErrorStatus.Text = "Message Sent"
Catch ex As Exception
lblErrorStatus.Text = ex.ToString()
End Try
'End If
'send email to me
End Sub
DougP
< I Built one