Solved

Send Form to Database and email?

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

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
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 make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now