I am creating a webform to send an email message using the System.Web.Mail Namespace. When the user clicks the submit button and the message is actually sent I want to redirect them to a confirmation page letting them know the message was sent succesfly.
How can I determine if the message was sent succesfly.
Here is the code I have so far
Code:Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If (Page.IsValid) Then Dim newMail As New MailMessage Try newMail.From = txtSendersEmailAddress.Text newMail.From = txtSenderName.Text newMail.Subject = ddlQueryType.SelectedValue + " " + txtSubject.Text newMail.To = "[email protected]" newMail.BodyFormat = MailFormat.Text newMail.Body = newMail.From + newMail.Subject + txtMessage.Text SmtpMail.SmtpServer = "your.smtpserver.net.net" SmtpMail.Send(newMail) Catch ex As Exception Finally newMail = Nothing End Try End If


Reply With Quote
