Solved

Send Form to Database and email?

Posted on 2004-08-27
9
362 Views
Last Modified: 2013-12-24
Is it possible to post form results to a database and send it to an email address? If so how do I do it?
0
Comment
Question by:annyearsley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 12

Expert Comment

by:rcmb
ID: 11924152
Take a look at MS KB article 288328

RCMB
0
 

Author Comment

by:annyearsley
ID: 11924606
I have read that one and several others that I am trying right now. I was just hoping it was as easy as clicking an option on the form properties dialog box.
0
 
LVL 12

Expert Comment

by:rcmb
ID: 11925701
Unfortunately it is not possible with FrontPage. Your problem is with the server extensions which will not allow you to send to email and an ASP page. Without the ASP page you cannot write to the database. You can use something like CDONTS to send your mail and then have the ASP to write to the database.

RCMB
0
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

Author Comment

by:annyearsley
ID: 11927581
I also have DreamWeaver MX 2004 and have been playing with ASP.net and PHP. Which one is the easiest to learn and run with DW? I am not much of a programmer, just a web designer. The easier the better! Thank you!
0
 
LVL 12

Expert Comment

by:rcmb
ID: 11927725
Not real familiar with PHP but it is suppose to be easier with DW than .net.

You can use just straight VBScript in ASP to create the solution you need. I have some stuff at work I can post tomorrow that will write to a database and send the email.

RCMB
0
 

Author Comment

by:annyearsley
ID: 11928116
You're great! I appreciate it.
Ann
0
 
LVL 12

Accepted Solution

by:
rcmb earned 250 total points
ID: 11936508
Okay this is what you need to do.

Create a form in FP and have it post to an asp page.

In the asp page have the first section write your database information with a SQL insert statement.

Now in the same page include the following code after the database region end.

<%
'Use this section to create variables from your form to include in the e-mail
var12 = request.form("FirstName")
var34 = request.form("LastName")

' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPort = 2

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' Set the CDOSYS configuration fields to use port 25 on the SMTP server.

With Flds
    .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
' Set your server IP address here
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "111.111.111.111"
    .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10  
    .Update
End With

' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b>Create your message body here</b></br>"
strHTML = strHTML & "<b>Information Posted: "
strHTML = strHTML & var12
strHTML = strHTML & " "
strHTML = strHTML & var34
strHTML = strHTML & "</b>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' Apply the settings to the message.
With iMsg
    Set .Configuration = iConf
    .To = "1234@mail.com"
    .Cc = "5678@mail.com"
    .From = "myaddress@mail.com"
    .Subject = "SOME SUBJECT LINE"
    .HTMLBody = strHTML
    .Send
End With

' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

response.redirect "confirmation.asp"

%>
0
 

Author Comment

by:annyearsley
ID: 11938293
Thanks a million. I am also going to take the SQL classes on VTC so I don't have to look like a dummy by asking questions!
Ann Yearsley
0
 
LVL 12

Expert Comment

by:rcmb
ID: 11939831
Do not be afraid to ask questions. You will never look like a dummy trying to learn more about designing the Internet.

Thanks for the points.

RCMB
0

Featured Post

Percona Monitoring and Management and Grafana

Proactive monitoring is vital to a highly-available environment. We have a quick start guide on Experts Exchange for Grafana users.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
Suggested Courses

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question