Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7958735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:28:02+00:00 2026-06-04T04:28:02+00:00

I ave a contact form (VS 2010 / VB / .net4), and when the

  • 0

I ave a contact form (VS 2010 / VB / .net4), and when the client fills out the form, I get an email — which I like, but ….

For instance, here’s an e-mail I got:

Email: ivy_league_alum-at-yahoo.com

Subject: Do you guys integrate PPT?

Message: I’m looking for a PPT integrator in the Michigan area.

First_Name: Tim

Last_Name: Dewar

Organization: American Axle

Browser: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.7 (KHTML, like
Gecko) Chrome/16.0.912.75 Safari/535.7

IP Address: 184.60.79.96

Server Date & Time: 1/13/2012 11:28:59 AM

This is just a lead-generating company, so we’re gonna get a lot of emails and we’re gonna want them organized.

It was suggested by Jon P that I use a database to gather all these emails I’m getting, instead of MS Excel (which I wouldn’t know how to do anyway). So I downloaded SQL Server Express. So now what do I do? Can someone please tell me what I have to add to the code, specifically, or what I have to do, so I can gather these emails in an organized manner? Thanks!

Addendum (I know this is long):

Specifically, my email code is:

<%@ Page Title=”Contact Health Nutts” Language=”VB”
MasterPageFile=”~/Site.master” AutoEventWireup=”false”
CodeFile=”contact.aspx.vb” Inherits=”contact” %>

Protected Sub SubmitForm_Click(ByVal sender As Object, ByVal e As System.EventArgs)
If Not Page.IsValid Then Exit Sub

        Dim SendResultsTo As String = "jason.weber-at-healthynutts.com"
        Dim smtpMailServer As String = "smtp.healthynutts.com"
        Dim smtpUsername As String = "jason.weber-at-healthynutts.com"
        Dim smtpPassword As String = "********"
        Dim MailSubject As String = "Form Results"

        Try
            Dim txtQ As TextBox = Me.FormContent.FindControl("TextBoxQ")
            If txtQ IsNot Nothing Then
                Dim ans As String = ViewState("hf1")
                If ans.ToLower <> txtQ.Text.ToLower Or ans.ToUpper <> txtQ.Text.ToUpper Then
                    Me.YourForm.ActiveViewIndex = 3
                    Exit Sub
                End If
            End If

            Dim FromEmail As String = SendResultsTo
            Dim msgBody As StringBuilder = New StringBuilder()
            Dim sendCC As Boolean = False


            For Each c As Control In Me.FormContent.Controls
                Select Case c.GetType.ToString
                    Case "System.Web.UI.WebControls.TextBox"
                        Dim txt As TextBox = CType(c, TextBox)
                        If txt.ID.ToLower <> "textboxq" Then
                            msgBody.Append(txt.ID & ": " & txt.Text & vbCrLf & vbCrLf)
                        End If
                        If txt.ID.ToLower = "email" Then
                            FromEmail = txt.Text
                        End If
                        If txt.ID.ToLower = "subject" Then
                            MailSubject = txt.Text
                        End If
                    Case "System.Web.UI.WebControls.CheckBox"
                        Dim chk As CheckBox = CType(c, CheckBox)
                        If chk.ID.ToLower = "checkboxcc" Then
                            If chk.Checked Then sendCC = True
                        Else
                            msgBody.Append(chk.ID & ": " & chk.Checked & vbCrLf & vbCrLf)
                        End If

                    Case "System.Web.UI.WebControls.RadioButton"
                        Dim rad As RadioButton = CType(c, RadioButton)
                        msgBody.Append(rad.ID & ": " & rad.Checked & vbCrLf & vbCrLf)
                    Case "System.Web.UI.WebControls.DropDownList"
                        Dim ddl As DropDownList = CType(c, DropDownList)
                        msgBody.Append(ddl.ID & ": " & ddl.SelectedValue & vbCrLf & vbCrLf)
                End Select
            Next
            msgBody.AppendLine()

            msgBody.Append("Browser: " & Request.UserAgent & vbCrLf & vbCrLf)
            msgBody.Append("IP Address: " & Request.UserHostAddress & vbCrLf & vbCrLf)
            msgBody.Append("Server Date & Time: " & DateTime.Now & vbCrLf & vbCrLf)

            Dim myMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage()
            myMessage.To.Add(SendResultsTo)
            myMessage.From = New System.Net.Mail.MailAddress(FromEmail)
            myMessage.Subject = MailSubject
            myMessage.Body = msgBody.ToString
            myMessage.IsBodyHtml = False
            If sendCC Then myMessage.CC.Add(FromEmail)


            Dim basicAuthenticationInfo As New System.Net.NetworkCredential(smtpUsername, smtpPassword)
            Dim MailObj As New System.Net.Mail.SmtpClient(smtpMailServer)
            MailObj.Credentials = basicAuthenticationInfo
            MailObj.Send(myMessage)

            Me.YourForm.ActiveViewIndex = 1
        Catch
            Me.YourForm.ActiveViewIndex = 2
        End Try
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not Page.IsPostBack Then
            Dim lbl As Label = Me.FormContent.FindControl("labelq")
            If lbl IsNot Nothing Then
                Dim rq(3) As String
                rq(0) = "Is fire hot or cold?"
                rq(1) = "Is ice hot or cold?"
                rq(2) = "Is water wet or dry?"

                Dim ra(3) As String
                ra(0) = "hot"
                ra(1) = "cold"
                ra(2) = "wet"

                Dim rnd As New Random
                Dim rn As Integer = rnd.Next(0, 3)
                lbl.Text = rq(rn)
                ViewState("hf1") = ra(rn)
            End If
        End If
    End Sub
</script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> <h1>CONTACT HEALTH

NUTTS AND WORK FROM THE COMFORT OF YOUR OWN HOME!

Enter your Email Address:

* Required
* Please enter a valid email address.

Subject:

* Required

Please type your message below:
* Required

First Name:

* Required

Last Name:

* Required

Phone Number:

* Required
* Please enter a valid U.S. phone number (including dashes).

City:

* Required

State/Province:

* Required

Your message has been sent. Thank you for contacting us.

Due to technical difficulty, your message may NOT have been sent.

You did not correctly answer the anti-spam question. Please go back and try again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:28:03+00:00Added an answer on June 4, 2026 at 4:28 am

    Don’t take this the wrong way, but judging by what you’ve said about your lack of coding abilities, it may work out cheaper for you to get someone else to do the work for you. A competent coder should be able to knock something out for you in about an hour, probably less if he doesn’t stop for coffee.

    If you do really really want to do it yourself, then first off, you’re going to have to find out if the hosting packing for the website includes a database or not.

    Assuming you don’t host the website on your local machine, then having a version of SQL Express on your machine will help you develop the code, but you won’t be able to deploy it.

    Completely ignoring that though, steps you want to go through are:

    1. Create the database in SQL, then create the relevant database
      table
    2. Create a connection from the website to the database using ADO.Net
    3. Create the code to insert the contact form data into the database table

    You then need to think about how you’re going to view the data once it’s been collected, so you’re either going to have to write something or learn SQL.

    If you want some code samples to help you get going, then we need to know what language you’re using (it should be C# or VB.Net) and posting the code for the contact form would help as well (obviously deleting any sensitive details, such as usernames and passwords).

    EDIT:

    Once you’ve created the database, this script should give you a basic table structure in SQL Express:

    CREATE TABLE [dbo].[tblEmails](
        [EmailID] [int] IDENTITY(1,1) NOT NULL,
        [EmailAddress] [nvarchar](200) NOT NULL,
        [Subject] [nvarchar](200) NOT NULL,
        [Message] [nvarchar](max) NOT NULL,
        [FirstName] [nvarchar](50) NOT NULL,
        [LastName] [nvarchar](50) NOT NULL,
        [PhoneNumber] [nvarchar](20) NOT NULL,
        [City] [nvarchar](50) NOT NULL,
        [State] [nvarchar](50) NOT NULL,
     CONSTRAINT [PK_tblEmails2] PRIMARY KEY CLUSTERED 
    (
        [EmailID] ASC
    )WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    
    GO
    

    To use it, right click on the database in SQL Express, click New Query, paste the above into the window, then hit the Execute button, refresh the database and you shouldn’t see the table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ave a contact form (VS 2010 / VB / .net4), and when the
i'v got a problem with the Report Viewer form .NET 2008. I'ave to get
I thought this will be trivial but I can't get this to work. Assume
I am trying to parse out a text file that looks like the following:
I have a table looks like: AV AVE AVENUE AVE AVEAPT AVE APT #
I have an old table which has a column like this 1 | McDonalds
I have a do a project for school with classic asp which I ave
So reverse geocoding, the result looks like this: results[0].formatted_address: 275-291 Bedford Ave, Brooklyn, NY
Hi I ave a drop down menu which when dropped, there is a gap
I've got a spreadsheet which looks like this: A B C D FirstName SurnameName

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.