<%@ 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>
Sub Send2Mail(ByVal sender As Object, ByVal e As EventArgs)
Dim objMail As New MailMessage()
objMail.To = "igors@optimumcomp.com"
objMail.From = strEmail.Text
objMail.BodyFormat = MailFormat.Text
objMail.Priority = MailPriority.Normal
objMail.Subject = "HealthyChats.com Spanish 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
If checkbox1.Checked Then
objMail.Body &= vbNewLine & "checkbox1 is checked"
End If
If checkbox2.Checked Then
objMail.Body &= vbNewLine & "checkbox2 is checked"
End If
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(objMail)
Response.Redirect("email_confirm.htm")
End Sub
objMail.Body =IIF(checkbox1.checked,"Checkbox1 is checked","") + vbNewLine + IIF(checkbox2.checked,"Checkbox2 is checked","")+ vbNewLine + "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
Open in new window