ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 13th, 2004, 01:34 PM
baz0hara baz0hara is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 27 baz0hara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old January 13th, 2004, 02:23 PM
jstrohofer jstrohofer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Cincinnati, OH USA
Posts: 111 jstrohofer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 3 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old January 13th, 2004, 07:23 PM
baz0hara baz0hara is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 27 baz0hara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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?

Reply With Quote
  #4  
Old January 14th, 2004, 09:21 AM
jstrohofer jstrohofer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Cincinnati, OH USA
Posts: 111 jstrohofer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 3 sec
Reputation Power: 6
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

Reply With Quote
  #5  
Old January 15th, 2004, 05:52 PM
xtremcoder xtremcoder is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Houston, TX
Posts: 134 xtremcoder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 15 m 26 sec
Reputation Power: 6
Send a message via AIM to xtremcoder Send a message via Yahoo to xtremcoder
write your info to a database then get it from there... jquintana@simplifiedsolutionz.com if you need more help.

Reply With Quote
  #6  
Old January 16th, 2004, 04:58 PM
baz0hara baz0hara is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 27 baz0hara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #7  
Old January 17th, 2004, 12:08 PM
baz0hara baz0hara is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 27 baz0hara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
please reply in the foillowing thread

http://forums.devshed.com/showthrea...threadid=113706

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Email Options With CDONTS 1.2


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT