Spooky's Databases >
Advanced Tips > Sending E-Mail Confirmation
When using a form to submit to database, there are not
many options when it comes to "Confirmations"
This method will demonstrate sending an E-Mail to you
as a confirmation that a submission has been made.
It assumes you have some sort of E-Mail component
installed on your server (hence it cannot be tested locally on PWS)
- Open the file "fpdbform.inc" (which is in the
hidden directory "_fpclass")
- You need to locate the function "Function
FP_FormConfirmation" which is on about line 52.
- This function is used for the "generic"
confirmation when a database submission is made.
- Between these two lines :
Function
FP_FormConfirmation(szCharset, szTitle, szmsg1, szUrl, szMsg2)
Response.Write "<html>" & vbCrLf
- You will add a generic CDO for NTS Email script.
(Note, that you can use any ASP email script, it depends what your
server has installed)
Function
FP_FormConfirmation(szCharset, szTitle, szmsg1, szUrl, szMsg2)
sFrom = Whoever
sTo = "YourEmailAddress"
sSubject = szTitle
sBody = "Your body text"
Set myCDONTSMail=
CreateObject("CDONTS.NewMail")
myCDONTSMail.BodyFormat= 1
MyCDONTSMail.MailFormat= 0
myCDONTSMail.Importance= 2
myCDONTSMail.Send sFrom, sTo, sSubject, sBody
Set myCdontsMail= Nothing
Response.Write
"<html>" & vbCrLf
- The "s" variables can be modified to suit, or can
contain requests for form or hidden contents from the submission form
NOTE!
Any modifications to this file are global! ALL database submission forms
within your application will use the same settings.
Any changes made by you, will be overwritten the next time you modify a
Database Region Wizard or republish, so keep a copy of your new file!!
As usual, you test at your own risk!
Here's What Microsoft have to say about it, and (not
surprisingly) they don't use the DRW to achieve it!
http://support.microsoft.com/support/kb/articles/q275/2/51.ASP
Here's another
option also!
http://www.frontpagehowto.com/dbandemail.htm
|