View Full Version : how to make a contact.aspx form
sandturtle
10-26-2004, 06:42 AM
i just want to make a simple contactus.aspx form with.NET but i can't get anything working, does anyone know how to make one or already have one? I just want one with some simple input fields like:
Name
Address
City
State
Zip
Phone
Comments
bruce
10-26-2004, 07:23 AM
What exactly are you trying to do?
Have those form information send to you via email or store in a DB??
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
sandturtle
10-26-2004, 07:38 AM
Hi Bruce, Yea i wanted to have this information just emailed to my email, i wanted something exactly like you have on this site like example here https://my.discountasp.net/support.aspxbut instead i wanted to have input fields:
Name
Company
Address
City
State
Zip
Phone#
Comments (text box)
i looked all over hotscripts, 411asp, aspin and can'tfind anything for a simple .NET form to email script
bruce
10-26-2004, 10:11 AM
This is a sample
<%@ Import Namespace='System.Web.Mail' %>
<script language='VB' runat='server'>
Sub Submit(sender As Object, E as EventArgs)
Try
Dim Mailer As MailMessage
Mailer = New MailMessage()
Mailer.From = 'someone@someplace.com'
Mailer.To = tbEmail.text
Mailer.Subject = 'Subject Line'
Mailer.Body = 'Box 1: ' & tbText1.Text & vbCrLf & 'Box 2: ' & tbText2.Text & vbCrLf & 'Box 3: ' & tbText3.Text & vbCrLf
Mailer.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer = 'localhost'
SmtpMail.Send(Mailer)
Response.Write('Mail sent successfully')
Catch ex As Exception
Response.Write('Your message was not sent: ' + ex.Message)
End Try
End Sub
</script>
<HTML>
<HEAD>
<title></title>
</HEAD>
[b]
<form id='mail_test' method='post' runat='server'>
<asp:Label id='lblHeader' runat='server' />
<table>
<tr><td>Email: </td><td><asp:TextBox id='tbEmail' runat='server' /></td></tr>
<tr><td>Box 1: </td><td><asp:TextBox id='tbText1' runat='server' /></td></tr>
<tr><td>Box 2: </td><td><asp:TextBox id='tbText2' runat='server' /></td></tr>
<tr><td>Box 3: </td><td><asp:TextBox id='tbText3' runat='server' /></td></tr>
<tr><td><asp:Button id='btSubmit' runat='server' Text='Submit' OnClick='Submit' /></td><td></td>
</table>
</form>
</body>
</HTML>
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
sandturtle
10-27-2004, 01:34 AM
Works Great, Thank You Very much !!!
vBulletin® ©Jelsoft Enterprises Ltd.