Solved

Send Form to Database and email?

Posted on 2004-08-27
9
360 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
  • 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

821 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