|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Email Options With CDONTS 1.2
ok I am trying to help out my friend by creating a invoicing page in ASP for his business, basically consisting of 3 pages :
(no sensitive info will be asked for.. ) 1.info submission page -cust enters his info 2.info summary -cust info summarised plus quote calculated 3.invoice page -quote emailed for invoicing. At present I have made the initial set up and it works fine. However, I am using CDONTS 1.2 to email the gathered cookies with the following code. <% Dim objMessage Set objMessage = Server.CreateObject("CDONTS.NewMail") objMessage.Send Request.Cookies("emailAddress"),"garrybibson@hotmail.com",Request.Cookies("subject"),Request.Cookies("body") Set objMessage = Nothing %> (emailAddress,subject and body being fields from prev page.) This works fine if i only wanted to email info from a single text box "body" but in reality i will have info from at least 10 that will need to be recorded! Is it possible to send more than a single cookie in the body section? alternatively, is there a way to store the info from a number of different form boxes into the same cookie? I am not sure what way i need to go, i am guessing the last as it would use fewer cookies but I am unsure of how to procede with either method. Any help and advice would be greatly appreciated thanks in advance - Barry. I am new to ASP and this is my first real venture so any help would be greatly appreciated. |
|
#2
|
|||
|
|||
|
Instead of using cookies, you could just grab the information from the Request.Form object.
Say you have a few different text boxes, we'll name them txt1, txt2, and txt3 for example. You could create a variable and concatenate strings together for this variable. For example: dim strBody strBody = "This is the beginning of the string. " & vbcrlf strBody = strBody & "I will add whatever is in txt1 now: " & request.form("txt1") & vbcrlf strBody = strBody & "I will add txt2 now: " & request.form("txt2") & vbcrlf strBody = strBody & "I will add txt3 now: " & request.form("txt3") & vbcrlf 'Now you can create the mail object as you did above, but replace where the body is with the variable strBody Dim objMessage Set objMessage = Server.CreateObject("CDONTS.NewMail") objMessage.Send Request.Cookies("emailAddress"),"garrybibson@hotmail.com",Request.Cookies("subject"),strBody Set objMessage = Nothing 'To me it is easier to break it apart as follows: Dim objMessage Set objMessage = Server.CreateObject("CDONTS.NewMail") objMessage.To = request.cookies("emailAddress") objMessage.From = "garrybibson@hotmail.com" objMessage.Subject = request.cookies("subject") objMessage.Body = strBody objMessage.Send Set objMessage = nothing Hope that helps! -- Jill |
|
#3
|
|||
|
|||
|
ok yes it does thanks very much .. but as it is the third page that has the email object would the request.form have not expired by then?
problem is i need a summary page where it calculates a quote to see if they want to "have" the invoice "or not" based on the quote .. perhaps i can use your method above and then make strBody into a cookie to take to the third page where the email object is .. is that possible? |
|
#4
|
|||
|
|||
|
For example, if you are saving all of the form collection into a cookie, you would then save txt1 into a cookie, txt2, and txt3 as well. Then in the code I provided, instead of referencing request.form("txt1") you would reference request.cookies("whateveryounamedtxt1").
Hope that helps. -- Jill |
|
#5
|
|||
|
|||
|
write your info to a database then get it from there... jquintana@simplifiedsolutionz.com if you need more help.
|
|
#6
|
|||
|
|||
|
thnx guys, great help .. so far i have got this far
http://aa.1asphost.com/barryjw/quoteInfo.asp (just an example of what i want to do) my problem is now my friend tells me that he wants to be able to add several "windows" (as most ppl do buy more than one) before "sending the invoice" so on the summary page there would possibly be an option to go back to the quoteinfo.asp page and it would add another "window 2" to the summarry page ... obviously my problem is that my cookie will be overwritten on the second loop and will only contain info from the most recent loop. how can i get around this? is it possible with cookies or do i need to start going into databases? this is as complicated as i need to get no other mods will be needed after. nb. the third page does not work as the freehost does not allow cdonts here is my current code. quoteInfoSummary.asp <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Response.Cookies("emailAddress") = Request.Form("emailAddress") %> <% Response.Cookies("jubilee") ("fullName")= Request.Form("fullName") %> <% Response.Cookies("jubilee") ("address") = Request.Form("address") %> <% Response.Cookies("jubilee") ("windowType") = Request.Form("windowType") %> <% Response.Cookies("jubilee") ("windowArea") = Request.Form("windowArea") %> <% Response.Cookies("jubilee") ("extraOne") = Request.Form("extraOne") %> <% Response.Cookies("jubilee") ("extraTwo") = Request.Form("extraTwo") %> <% Response.Cookies("jubilee") ("extraThree") = Request.Form("extraThree") %> <% Dim strWindowType, intWindowArea, total, intWindowCost strWindowType=Request.Form("windowType") intWindowArea=Request.Form("windowArea") If strWindowType = "finish 1" then intWindowCost = 5 ElseIf strWindowType = "finish 2" then intWindowCost = 4 ElseIf strWindowType = "finish 3" then intWindowCost = 3 Else intWindowCost = 1 End If total = (intWindowCost*intWindowArea) %> quoteinfo_processor.asp <% Dim objMessage Set objMessage = Server.CreateObject("CDONTS.NewMail") objMessage.Send Request.Cookies("emailAddress"),"garrybibson@hotmail.com","Quote from blah blah blah",Request.Cookies("jubilee") Set objMessage = Nothing %> again any help or advise is appreciated Barry |
|
#7
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Email Options With CDONTS 1.2 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|