C
csteacy
Hello,
I am pretty new to asp.net and I've been trying to figure out how to
take a static HTML web form data and send it to an asp.net page to
validate 1 field and then if it passes the validation, create an e-
mail message using jmail and send it to the specified e-mail address.
I've tried using an if then else statement but am really lost in the
coding. I've added some code below to give an idea of what I'm trying
for the asp.net page:
<%@Page Language="VB" validateRequest="false" %>
<%@Import Namespace="Dimac.JMail" %>
<html>
<title>validate</title>
<body bgcolor="#FFFFFF">
<%
Dim validate
Validate = Trim(Request.Form("validate"))
' Check the message field for input if is blank
' then add to the display message
If validate() = "" Then
Response.Redirect("notsent.html")
' If all seems ok begin processing the email
Else
Sub Page_Load( ByVal sender As Object, Byval e As EventArgs )
Dim obj As New Message()
Message.From.Email = "(e-mail address removed)"
Message.To.Add("(e-mail address removed)", "")
Message.Bcc.Add("(e-mail address removed)", "")
Message.Subject = "form subject"
Message.BodyText = "Phone: " & Request.Form("txtphone")
Try
Smtp.Send(Message, "smtpserver")
Response.Redirect("submitted.html")
Catch ex As Exception
End Try
End Sub
End If%>
</body>
</html>
I'm posting the HTML page to the asp.net page but with no results.
Could someone point me in the right direction? Thank you in advance
for your help.
I am pretty new to asp.net and I've been trying to figure out how to
take a static HTML web form data and send it to an asp.net page to
validate 1 field and then if it passes the validation, create an e-
mail message using jmail and send it to the specified e-mail address.
I've tried using an if then else statement but am really lost in the
coding. I've added some code below to give an idea of what I'm trying
for the asp.net page:
<%@Page Language="VB" validateRequest="false" %>
<%@Import Namespace="Dimac.JMail" %>
<html>
<title>validate</title>
<body bgcolor="#FFFFFF">
<%
Dim validate
Validate = Trim(Request.Form("validate"))
' Check the message field for input if is blank
' then add to the display message
If validate() = "" Then
Response.Redirect("notsent.html")
' If all seems ok begin processing the email
Else
Sub Page_Load( ByVal sender As Object, Byval e As EventArgs )
Dim obj As New Message()
Message.From.Email = "(e-mail address removed)"
Message.To.Add("(e-mail address removed)", "")
Message.Bcc.Add("(e-mail address removed)", "")
Message.Subject = "form subject"
Message.BodyText = "Phone: " & Request.Form("txtphone")
Try
Smtp.Send(Message, "smtpserver")
Response.Redirect("submitted.html")
Catch ex As Exception
End Try
End Sub
End If%>
</body>
</html>
I'm posting the HTML page to the asp.net page but with no results.
Could someone point me in the right direction? Thank you in advance
for your help.