This link will not appear on my computer. I rebooted to see if I had too
many things open. Still not. Only the hour glass forever.
I entered the site by hand and received the following message:
We're sorry. The Web address you entered is not a functioning page on our
site
Sub btnSendFeedback _Click(sender as Object, e as EventArgs)
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the properties - send the email to the person who filled out
the
'feedback form.
objMM.To = "webmaster@your site.com"
objMM.From = txtEmail.Text
'If you want to CC this email to someone else, uncomment the line
below
'objMM.Cc = "someone@somead dress.com"
'If you want to BCC this email to someone else, uncomment the line
below
'objMM.Bcc = "someone@somead dress.com"
'Send the email in text format
objMM.BodyForma t = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html )
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.No rmal
'Set the subject
objMM.Subject = "4GuysFromRolla .com - Feedback"
'Set the body
objMM.Body = "At " + DateTime.Now + " feedback was sent from an
ASP.NET " & _
"Web page. Below you will find the feedback message "
& _
"send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
"---------------------------------------" & vbCrLf &
vbCrLf & _
txtMessage.Text & vbCrLf
'Specify to use the default Smtp Server
SmtpMail.SmtpSe rver = ""
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(o bjMM)
panelSendEmail. Visible = false
panelMailSent.V isible = true
End Sub
</script>
<html>
<body>
<asp:panel id="panelSendEm ail" runat="server">
<form runat="server">
<h2>We are interested in your feedback! Please enter the
following
requested information below to send us your comments.</h2>
<asp:panel id="panelMailSe nt" runat="server" Visible="False" >
An email has been sent to the email address you specified.
Thanks!
</asp:panel>
</body>
</html>
This code works well alone. When I enter it into the page where I want to
use it, I get this error:
Unexpected end of file looking for </formtag.
I HAVE a </formtag.
I am not using Visual Studio. It is simple ASP.NET coded in notepad.
Any ideas?
"Alexey Smirnov" <alexey.smirnov @gmail.comwrote in message
news:1178648486 .446319.3630@l7 7g2000hsb.googl egroups.com...
On May 8, 3:02 pm, "dancer" <dan...@microso ft.comwrote:
>I have created a form in ASP.NET.
>Now how do I get the results on another page (a pretty one) and email to
>myself?
>
you can use the same "page"
>
<% @Import Namespace="Syst em.Web.Mail" %>
<script language="vb" runat="server">
>
Sub btnSendFeedback _Click(sender as Object, e as EventArgs)
>
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
>
'Set the properties - send the email to the person who filled out
the
'feedback form.
objMM.To = "webmaster@your site.com"
objMM.From = txtEmail.Text
>
'If you want to CC this email to someone else, uncomment the line
below
'objMM.Cc = "someone@somead dress.com"
>
'If you want to BCC this email to someone else, uncomment the line
below
'objMM.Bcc = "someone@somead dress.com"
>
'Send the email in text format
objMM.BodyForma t = MailFormat.Text
'(to send HTML format, change MailFormat.Text to MailFormat.Html )
>
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.No rmal
>
'Set the subject
objMM.Subject = "4GuysFromRolla .com - Feedback"
>
'Set the body
objMM.Body = "At " + DateTime.Now + " feedback was sent from an
ASP.NET " & _
"Web page. Below you will find the feedback message "
& _
"send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
"---------------------------------------" & vbCrLf &
vbCrLf & _
txtMessage.Text & vbCrLf
>
>
'Specify to use the default Smtp Server
SmtpMail.SmtpSe rver = ""
>
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(o bjMM)
>
>
panelSendEmail. Visible = false
panelMailSent.V isible = true
End Sub
>
</script>
>
<html>
<body>
<asp:panel id="panelSendEm ail" runat="server">
<form runat="server">
<h2>We are interested in your feedback! Please enter the
following
requested information below to send us your comments.</h2>
>
<b>Your Name:</b>
<asp:textbox id="txtName" runat="server" />
<br>
>
<b>Your Email Address:</b>
<asp:textbox id="txtEmail" runat="server" />
<p>
>
<b>Your Message:</b><br>
<asp:textbox id="txtMessage " TextMode="Multi Line"
Columns="40" Rows="10" runat="server" />
<p>
>
<asp:button runat="server" id="btnSendFeed back" Text="Send
Feedback!"
OnClick="btnSen dFeedback_Click " />
</form>
</asp:panel>
>
>
<asp:panel id="panelMailSe nt" runat="server" Visible="False" >
An email has been sent to the email address you specified.
Thanks!
</asp:panel>
</body>
</html>
>
"dancer" <dancer@microso ft.comwrote in message news:uvqvhqZkHH A.4248@TK2MSFTN GP06.phx.gbl...
This link will not appear on my computer. I rebooted to see if I had too many things open. Still not. Only the hour glass
forever.
I entered the site by hand and received the following message:
>
We're sorry. The Web address you entered is not a functioning page on our site
>
????
>
"Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere dot comwrote in message news:eLkuSPXkHH A.3656@TK2MSFTN GP06.phx.gbl...
Sub btnSendFeedback _Click(sender as Object, e as EventArgs)
'Create an instance of the MailMessage class
Dim objMM as New MailMessage()
'Set the properties - send the email to the person who filled out
the
'feedback form.
objMM.To = "xxxxxxxx@xxxxx xxx.com"
objMM.From = "xxxxxxxxx@xxxx xxxx.com"
'send in html format
objMM.BodyForma t = MailFormat.Html
'Set the priority - options are High, Low, and Normal
objMM.Priority = MailPriority.No rmal
'Set the subject
objMM.Subject = "4GuysFromRolla .com - Feedback"
'Set the body
objMM.Body = "At " + DateTime.Now + " feedback was sent from an
ASP.NET " & _
"Web page. Below you will find the feedback message " & _
"send by " & txtName.Text & "." & vbCrLf & vbCrLf & _
"---------------------------------------" & vbCrLf &vbCrLf & _
txtMessage.Text & vbCrLf
'Specify to use the default Smtp Server
SmtpMail.SmtpSe rver = ""
'Now, to send the message, use the Send method of the SmtpMail class
SmtpMail.Send(o bjMM)
panelSendEmail. Visible = false
panelMailSent.V isible = true
End Sub
Yep!
When I moved the </formto AFTER the other controls, it worked. Thank
you!
Now, how can I get it to send the info from the WHOLE form on the page, and
not just some text?
"Mark Rae" <mark@markNOSPA Mrae.netwrote in message
news:%23DHNatkk HHA.3264@TK2MSF TNGP04.phx.gbl. ..
"dancer" <dancer@microso ft.comwrote in message
news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
>
>Here is the code: I'll be very grateful if you can find my error.
>
Hmm - I may be wrong here, but don't all webcontrols need to be inside the
<formtag...?
>
-- http://www.markrae.net
Not quite... you can have literal outside. In fact, I have used it in the
header to change the page title or meta tags (though I have started a thread
related to literal tags.). There may be other controls as well that you can
have outside your form tag. (Obviously, buttons, form fields etc have to be
inside)
On May 9, 5:48 pm, "dancer" <dan...@microso ft.comwrote:
Yep!
When I moved the </formto AFTER the other controls, it worked. Thank
you!
Now, how can I get it to send the info from the WHOLE form on the page, and
not just some text?
>
"Mark Rae" <m...@markNOSPA Mrae.netwrote in message
>
news:%23DHNatkk HHA.3264@TK2MSF TNGP04.phx.gbl. ..
>
>
>
"dancer" <dan...@microso ft.comwrote in message
news:unJZGhkkHH A.4852@TK2MSFTN GP03.phx.gbl...
>
Here is the code: I'll be very grateful if you can find my error.
>
Hmm - I may be wrong here, but don't all webcontrols need to be inside the
<formtag...?
OK, I did that. (Referenced the controls to get the other answers to the
form to appear.)
Now, how do I get the email to be formatted in the same fashion as the form
that the user fills out?
Thank you.
"Alexey Smirnov" <alexey.smirnov @gmail.comwrote in message
news:1178732903 .084951.269160@ w5g2000hsg.goog legroups.com...
On May 9, 5:48 pm, "dancer" <dan...@microso ft.comwrote:
>Yep!
>When I moved the </formto AFTER the other controls, it worked. Thank
>you!
>Now, how can I get it to send the info from the WHOLE form on the page,
>and
>not just some text?
>>
>"Mark Rae" <m...@markNOSPA Mrae.netwrote in message
>>
>news:%23DHNatk kHHA.3264@TK2MS FTNGP04.phx.gbl ...
>>
>>
>>
"dancer" <dan...@microso ft.comwrote in message
>news:unJZGhkkH HA.4852@TK2MSFT NGP03.phx.gbl.. .
>>
>Here is the code: I'll be very grateful if you can find my error.
>>
Hmm - I may be wrong here, but don't all webcontrols need to be inside
the
<formtag...?
>
As in the given example you have to reference the controls on the ASPX
page
>
Date.Text gives a text of the Date control (Date of accident)
CheckBox1.Check ed gives true of false of the CheckBox1 (Employer's
Premises)
etc.
>
Comment