how to make a contact.aspx form

Discussion in 'ASP.NET / ASP.NET Core' started by sandturtle, Oct 26, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    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
     
  3. 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
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    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 = '[email protected]'
    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>

    <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
     
  5. Works Great, Thank You Very much !!!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page