Hello all! Thank you for stopping by.
I'm using the following code to email the values entered in the form. The form was created using the Wizard in the toolbox menu under Standard. The form contains mostly text boxes with a few check boxes. How can I email the check box values? If I use for example, chkBox1.text, that emails the actual check box label and not the "Yes/No" or "True/False" values. If I use chkBox1.checked, I get an error message when I preview the page.
Private Sub SendMail(ByVal from As String, ByVal body As String)
Dim bodyText As String
bodyText = "First Name: " + txtFirst.Text + vbNewLine _
+ "Last Name: " + txtLast.Text + vbNewLine _
+ "Phone Number: " + txtPhone.Text + vbNewLine + vbNewLine _
+ "Selection: "
Dim mailServerName As String = "smtp.mail.net"
Dim message As MailMessage = New MailMessage(from, "email@address.com", "Website Contact", bodyText)
Dim mailClient As SmtpClient = New SmtpClient
mailClient.Host = mailServerName
mailClient.Send(message)
message.Dispose()
End Sub
I really appreciate your time and assistance in this matter.
Rey
I'm using the following code to email the values entered in the form. The form was created using the Wizard in the toolbox menu under Standard. The form contains mostly text boxes with a few check boxes. How can I email the check box values? If I use for example, chkBox1.text, that emails the actual check box label and not the "Yes/No" or "True/False" values. If I use chkBox1.checked, I get an error message when I preview the page.
Private Sub SendMail(ByVal from As String, ByVal body As String)
Dim bodyText As String
bodyText = "First Name: " + txtFirst.Text + vbNewLine _
+ "Last Name: " + txtLast.Text + vbNewLine _
+ "Phone Number: " + txtPhone.Text + vbNewLine + vbNewLine _
+ "Selection: "
Dim mailServerName As String = "smtp.mail.net"
Dim message As MailMessage = New MailMessage(from, "email@address.com", "Website Contact", bodyText)
Dim mailClient As SmtpClient = New SmtpClient
mailClient.Host = mailServerName
mailClient.Send(message)
message.Dispose()
End Sub
I really appreciate your time and assistance in this matter.
Rey