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

  • SEARCH
  • Home
  • 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 7996833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:48:20+00:00 2026-06-04T14:48:20+00:00

I have a form email, asp.net 4.0 / VB / Visual Studio, and I

  • 0

I have a form email, asp.net 4.0 / VB / Visual Studio, and I want it to go automatically into a Microsoft Access DB without any effort from me. Is this possible? I’m not a programmer, but here’s the form e-mail:

<script runat="server">
    Protected Sub SubmitForm_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        If Not Page.IsValid Then Exit Sub

        Dim SendResultsTo As String = "me@domain.com"
        Dim smtpMailServer As String = "smtp.domain.com"
        Dim smtpUsername As String = "me@domain.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.

When someone fills out the form, I get an e-mail like this:

Email: rmajeski@yahoo.com

Subject: I need A Job

Message: Me wants job today okay? Thank you for J.O.B

First_Name: Rich

Last_Name: Majeski

Phone: xxx-xxx-xxxx

City: Hockeytown

State: Michigan

Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101
Firefox/12.0

IP Address: 108.224.49.14

Server Date & Time: 5/15/2012 6:03:33 AM

How can I make this go into a Microsoft Access DB automatically, without me having to do it manually? Any guidance would be truly appreciated! Thanks!

  • 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-04T14:48:22+00:00Added an answer on June 4, 2026 at 2:48 pm

    You can have a read on tutorials on Office add-in programming.
    One way to go would be having this add-in looking at every incoming email in Outlook and parse the fields into corresponding variables. After that you can create a database connection to a MS Access database file to insert the data with an SQL-Insert DML statement.
    I think this would be the easiest way for you, as programming this will not take too many lines of code. But MS Outlook has to be running!

    The best way would of course be to create the database connection asynchronously (using ODBC) in ASP.NET. There should be a lot tutorials on that online.

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

Sidebar

Related Questions

I have an ASP.Net form and I want to send an email when the
I have a very basic email submission form in my ASP.NET MVC 3 app.
I have a simple email form written in ASP.NET with the logic in the
I have a asp.net web form which will submit information to come as emails.
i have a contact form sending itself to me by email using ASP classic,
I have a form with a name and an email address. I want a
I have a form that validates the email address and I want to be
I have a simple form on an ASP.NET MVC site that I'm building. This
I have a simple web form that sends and email out via .NET C#.
I'm building a form in ASP.NET to send an email. So far things work

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.