Solved

Send Form to Database and email?

Posted on 2004-08-27
9
358 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
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 connect a WordPress website to Google Analytics. 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 :…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

773 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