troubleshooting Question

VB.NET Email with Checkboxes

Avatar of datzent83
datzent83Flag for United States of America asked on
ASP.NETProgramming.NET Programming
8 Comments1 Solution358 ViewsLast Modified:
In the following code, how do I add

If checkbox1 is checked then add "checkbox 1 is checked"
If checkbox2 is checked then add "checkbox 2 is checked"

 into the body of the email?
<%@ Page Language="VB" Debug="true" %>
<% @Import Namespace="System.Web.Mail" %>
<script language="vb" runat="server">

Sub Send2Mail (sender as Object, e as EventArgs)

Dim objMail as New MailMessage()

  objMail.To = "test@test.com"
  objMail.From = strEmail.Text

  objMail.BodyFormat = MailFormat.Text
  objMail.Priority = MailPriority.Normal
  objMail.Subject = "Web Contact"

  objMail.Body = "Name: " + strName.Text + vbNewLine + "Email: " + strEmail.text + vbnewLine + "Work Phone: " + strWrkPhone.Text + vbnewLine + "Home Phone: " + strHomePhone.Text + vbnewLine + "Fax Number: " + strFaxNumber.Text + vbnewLine + "Message: " + strYourMsg.text
   
  SmtpMail.SmtpServer = "localhost"
  SmtpMail.Send(objMail)
   
  Response.Redirect("email_confirm.htm")

End Sub

</script>
ASKER CERTIFIED SOLUTION
PaulHews

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros