Forums
This topic is locked
Tutorial request
16 May 2002 01:01:47 M. Kissel posted:
hi,i wanna do this:
a form inserts data to the database
when i hit the submit button i want that the page also send two mails, one to the user another one to the webmaster
i use the ultradev insert into behavior and i also have the ultrasuitr but i cant get it work.
some said to me type this or that but it wont work. so is there a tut out there (with detailed instuctions - for newbies)
Thank you
Replies
Replied 16 May 2002 16:33:38
16 May 2002 16:33:38 Dave Clarke replied:
Hi
There are loads of tutorials out there on CDONTS or CDOmail or whatever you want to call it, but it really depends on what your server supports, some use CDONTS some use JMail others use something else.Contact your server and ask them.
Dave
There are loads of tutorials out there on CDONTS or CDOmail or whatever you want to call it, but it really depends on what your server supports, some use CDONTS some use JMail others use something else.Contact your server and ask them.
Dave
Replied 16 May 2002 18:22:30
16 May 2002 18:22:30 Matthijs Horsman replied:
I am not gonna write a whole tutorial but here's the basics you need i think.
After you insert the form, redirect to the next page were you make an email
Click here for the extenion
Then you need to change a little code in the Insert Record Behaviour because there's a little "bug" in the SB so read this
www.udzone.com/showDetail.asp?TypeId=2&NewsId=385
Then your pretty much set i think...
That's the way i do it, and it works great
Notice that the mail extenion is a BETA so... but it works great with JMAIL for me...
If you have any questions let me know...
Good luck
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
After you insert the form, redirect to the next page were you make an email
Click here for the extenion
Then you need to change a little code in the Insert Record Behaviour because there's a little "bug" in the SB so read this
www.udzone.com/showDetail.asp?TypeId=2&NewsId=385
Then your pretty much set i think...
That's the way i do it, and it works great
Notice that the mail extenion is a BETA so... but it works great with JMAIL for me...
If you have any questions let me know...
Good luck
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
Replied 17 May 2002 00:13:35
17 May 2002 00:13:35 M. Kissel replied:
well i have cdonts and jamail on the server
Edited by - M.Kissel on 17 May 2002 00:14:17
Edited by - M.Kissel on 17 May 2002 00:14:17
Replied 17 May 2002 01:44:15
17 May 2002 01:44:15 Matthijs Horsman replied:
mail extension works also for CDONTS... <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle><img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
Replied 17 May 2002 02:36:44
17 May 2002 02:36:44 David Behan replied:
Just after this bit of code here:
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
Try this in your code:
' email details
FORM_CONTACT = Request.Form("Contact"
FORM_COMPANY = Request.Form("Company"
FORM_EMAIL = Request.Form("Email Address"
FORM_IP = Request.Form("IPAddress"
FORM_PASSWORD = Request.Form("Random Password"
FORM_USERNAME = Request.Form("Username"
FORM_LINK = Request.Form("Random Link"
Dim strBody
strBody = strBody & vbCrLf & "=================================" & vbCrLf
strBody = strBody & "TYPE SUBJECT HERE" & vbCrLf
strBody = strBody & "=================================" & vbCrLf & vbCrLf
strBody = strBody & "Dear " & FORM_CONTACT & "," & vbCrLf & vbCrLf
strBody = strBody & "IP Address: " & FORM_IP & vbCrLf
strBody = strBody & "Company: " & FORM_COMPANY & vbCrLf
strBody = strBody & "Username: " & FORM_USERNAME & vbCrLf
strBody = strBody & "Password: " & FORM_PASSWORD & vbCrLf & vbCrLf strBody = strBody & "If there is anything else that we can do for, please do not hesitate to contact us." & vbCrLf & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "DYNAMIC WEB SOLUTIONS LTD" & vbCrLf
strBody = strBody & "Giving You Control" & vbCrLf
strBody = strBody & "www.site-manager.com" & vbCrLf & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = FORM_EMAIL
objCDO.From = " "
objCDO.Subject = "TYPE SUBJECT HERE"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = " "
objCDO.From = " "
objCDO.Subject = "TYPE SUBJECT HERE"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
Everything above Set objCDO is your variables for sending the email from your form and after you do your insert. The two seperate scripts takes the variables and sends them to the user and then the webmaster. Change the variables for request forms for getting the variables from your input form and just plug them into the script. Getting a look at other practical scripts can be a good way to learn. If you need more explanation... just SHOUT!
Regards,
Dave
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Edited by - beano on 17 May 2002 02:39:15
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command"
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
Try this in your code:
' email details
FORM_CONTACT = Request.Form("Contact"
FORM_COMPANY = Request.Form("Company"
FORM_EMAIL = Request.Form("Email Address"
FORM_IP = Request.Form("IPAddress"
FORM_PASSWORD = Request.Form("Random Password"
FORM_USERNAME = Request.Form("Username"
FORM_LINK = Request.Form("Random Link"
Dim strBody
strBody = strBody & vbCrLf & "=================================" & vbCrLf
strBody = strBody & "TYPE SUBJECT HERE" & vbCrLf
strBody = strBody & "=================================" & vbCrLf & vbCrLf
strBody = strBody & "Dear " & FORM_CONTACT & "," & vbCrLf & vbCrLf
strBody = strBody & "IP Address: " & FORM_IP & vbCrLf
strBody = strBody & "Company: " & FORM_COMPANY & vbCrLf
strBody = strBody & "Username: " & FORM_USERNAME & vbCrLf
strBody = strBody & "Password: " & FORM_PASSWORD & vbCrLf & vbCrLf strBody = strBody & "If there is anything else that we can do for, please do not hesitate to contact us." & vbCrLf & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "DYNAMIC WEB SOLUTIONS LTD" & vbCrLf
strBody = strBody & "Giving You Control" & vbCrLf
strBody = strBody & "www.site-manager.com" & vbCrLf & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = FORM_EMAIL
objCDO.From = " "
objCDO.Subject = "TYPE SUBJECT HERE"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = " "
objCDO.From = " "
objCDO.Subject = "TYPE SUBJECT HERE"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
Everything above Set objCDO is your variables for sending the email from your form and after you do your insert. The two seperate scripts takes the variables and sends them to the user and then the webmaster. Change the variables for request forms for getting the variables from your input form and just plug them into the script. Getting a look at other practical scripts can be a good way to learn. If you need more explanation... just SHOUT!
Regards,
Dave
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Edited by - beano on 17 May 2002 02:39:15