Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
changing CDONTS Code so you can read it easy in email
Old 07-20-2004, 08:44 AM changing CDONTS Code so you can read it easy in email
Experienced Talker

Posts: 37
Trades: 0
ive succesfully (at last) got an asp page which sends information both to a database and to an email (Using CDONTS)

One problem with CDONTS I have noticed is that when the information is sent via email the data shown is not the most user friendly

EG:

Code:
The following information was submitted:
Paul
Course
Yes
N/A
Mon, 1, Jan, 04
2, 3, 4, 5, 6
Yes
Yes
pworsnop@hotmail.com

Thank you for submitting your data.
How can i alter the code so something like this is shown in the email:

Code:
The following information was submitted:
Name: Paul
Reason:Course
Already Authorised:Yes
Details:N/A
Date:Mon, 1, Jan, 04
Periods Absent:2, 3, 4, 5, 6
Form Require Cover:Yes
Faculty Head Aware:Yes
Your Email:pworsnop@hotmail.com

Thank you for submitting your data.
This is the CDONTS code i have used:

Code:
Dim myCDONTSMail
Dim strFrom
Dim strTo
Dim strSubject
Dim strBody

strFrom=Request.Form("MyEmail")

strTo="pworsnop@wickersley.net"

strSubject = "Send to E-mail and Database"
 
strBody="The following information was submitted:" & Chr(13)
strBody= strBody & Request.Form("MyName") & Chr(13)
strBody= strBody & Request.Form("MyReason") & Chr(13)
strBody= strBody & Request.Form("MyAuthorised") & Chr(13)
strBody= strBody & Request.Form("MyDetails") & Chr(13)
strBody= strBody & Request.Form("MyDate") & Chr(13)
strBody= strBody & Request.Form("MyPeriods") & Chr(13)
strBody= strBody & Request.Form("MyCover") & Chr(13)
strBody= strBody & Request.Form("MyFaculty") & Chr(13)
strBody= strBody & Request.Form("MyEmail") & Chr(13)
strBody= strBody & Chr(13) & "Thank you for submitting your data."

Set myCDONTSMail = CreateObject("CDONTS.NewMail")
myCDONTSMail.Send strFrom,strTo,strSubject,strBody
Set myCDONTSMail = Nothing


%>
Thanks!
woody22 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-20-2004, 11:57 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
I dont knw much in this area, but.

where it goes:

strBody= strBody & Request.Form("MyName") & Chr(13)
strBody= strBody & Request.Form("MyReason") & Chr(13)
strBody= strBody & Request.Form("MyAuthorised") & Chr(13)
strBody= strBody & Request.Form("MyDetails") & Chr(13)
strBody= strBody & Request.Form("MyDate") & Chr(13)
strBody= strBody & Request.Form("MyPeriods") & Chr(13)
strBody= strBody & Request.Form("MyCover") & Chr(13)
strBody= strBody & Request.Form("MyFaculty") & Chr(13)
strBody= strBody & Request.Form("MyEmail") & Chr(13)

Dont you need to put a bit in that says show? you have all of them in ("....") which means it doesnt show the labels. I think that you need to add something before the (".....")



Mik
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 07-21-2004, 05:13 AM
Experienced Talker

Posts: 37
Trades: 0
thanks that worked a treat!
woody22 is offline
Reply With Quote
View Public Profile
 
Old 07-24-2004, 11:34 AM
whatNext's Avatar
Average Talker

Posts: 24
Trades: 0
could you also get away with something like:

strBody= strBody & "Name: " & Request.Form("MyName") & Chr(13) or set "Name: " as a variable and include it between concantonation operators?
whatNext is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to changing CDONTS Code so you can read it easy in email
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57390 seconds with 12 queries