User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 427,218 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,208 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 692 | Replies: 2
Reply
Join Date: Oct 2006
Posts: 19
Reputation: doraima29 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
doraima29 doraima29 is offline Offline
Newbie Poster

Help Is there a way to separate strings in Classic ASP

  #1  
Dec 19th, 2007
Hi,

Is there a way to separate strings in Classic ASP?

Here is the sample of the CODE:
<%@ Language=VBScript %>

<%
Option Explicit
%>

<%
' -----------------------------------------------------
' CDONTS Email send script
' © http://www.designplace.org/
' Comments must remain intact for re-use of this code
' -----------------------------------------------------

dim strFName, strLName, strEmailOne, strEmailTwo, strSchoolName, strAddress, strCity, strState, strCountry, strZipcode, strMessage, strQuestion1, strQuestion2,strQuestion3

strFName = Request.Form("fname") ' holds inputted first name
strLName = Request.Form("lname") ' holds inputted last name
strSchoolName = Request.Form("schoolname") ' holds inputted school name
strAddress = Request.Form("address") ' holds inputted school address
strCity = Request.Form("city") ' holds inputted school city
strState = Request.Form("states").Item ' holds selection of states
strZipcode = Request.Form("zipcode") ' holds zipcode or postal code
strCountry = Request.Form("country").Item ' holds selection of Country either Canada and United States
'strEmailOne = Request.Form("emailOne") ' holds inputted email address
strEmailTwo = Request.Form("emailTwo") ' holds inputted email address
strMessage = Request.Form("message") ' holds inputted message
strQuestion1 = Request.Form("edulevels").Item ' drop down list selection
strQuestion2 = Request.Form("OS").Item ' drop down list selection
strQuestion3 = Request.Form("softwareFormats").Item ' drop down list selection


dim objMail

Set objMail = Server.CreateObject("CDO.Message")
'Set objMail = CreateObject("CDONTS.NewMail")

' -- email variables --
objMail.From = Trim("feedback@avanquestusa.com")
objMail.To = Trim(strEmailTwo)
objMail.Subject = "Promotional Code for Avanquest Software Educator Perks Program"
'objMail.BodyFormat = "0" ' HTML format
objMail.TextBody = "Thank you" & Trim(strFName) & Trim(strLName) & "for submitting your application to Avanquest Software Educators Perks Program." & vbCrLf _
& vbCrLf _
& "School Information " & vbCrLf _
& vbCrLf _
& "School Name: " & Trim(strSchoolName) & vbCrLf _
& "School Address: " & Trim(strAddress) & Trim(strCity) & Trim(strState) & Trim(strZipcode) & vbCrLf _
& Trim(strCountry) & vbCrLf _
& vbCrLf _
& "You primarily work help students in: " & Trim(strQuestion1) & vbCrLf _
& vbCrLf _
& "The most common operating system used at your school is " & Trim(strQuestion2) & vbCrLf _
& vbCrLf _
& "Most of your current school software is " & Trim(strQuestion3) & vbCrLf _
& vbCrLf _
& "These are the products I want for the classroom which I cannot find on your website or from other publishers: " & Trim(strMessage)

' -- send the email --
objMail.Send()

' -- clean up object
Set objMail = Nothing

' -- execute confirmation page
Response.Redirect "thankyou.asp"
%>

-----------------------------------------------------
However the outcome of the email shows:
Thank youMIckJaggerfor submitting your application to Special Program

School Information

School Name: OhlineCollege

School Address: 23 jordan wayFremontCA94536
USA

You primarily work help students in: Grades 4 and 5

The most common operating system used at your school is Windows XP

Is there a way to separate the email in between spaces for the highlighted text. Each of the fields shown above are inputted by the user.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2007
Posts: 75
Reputation: hielo is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
hielo hielo is offline Offline
Junior Poster in Training

Re: Is there a way to separate strings in Classic ASP

  #2  
Dec 20th, 2007
You just need to add spaces:
<%@ Language=VBScript %>

<%
Option Explicit
%>

<%
' -----------------------------------------------------
' CDONTS Email send script
' © http://www.designplace.org/
' Comments must remain intact for re-use of this code
' -----------------------------------------------------

dim strFName, strLName, strEmailOne, strEmailTwo, strSchoolName, strAddress, strCity, strState, strCountry, strZipcode, strMessage, strQuestion1, strQuestion2,strQuestion3

strFName = Request.Form("fname") ' holds inputted first name
strLName = Request.Form("lname") ' holds inputted last name
strSchoolName = Request.Form("schoolname") ' holds inputted school name
strAddress = Request.Form("address") ' holds inputted school address
strCity = Request.Form("city") ' holds inputted school city
strState = Request.Form("states").Item ' holds selection of states
strZipcode = Request.Form("zipcode") ' holds zipcode or postal code
strCountry = Request.Form("country").Item ' holds selection of Country either Canada and United States
'strEmailOne = Request.Form("emailOne") ' holds inputted email address
strEmailTwo = Request.Form("emailTwo") ' holds inputted email address
strMessage = Request.Form("message") ' holds inputted message
strQuestion1 = Request.Form("edulevels").Item ' drop down list selection
strQuestion2 = Request.Form("OS").Item ' drop down list selection
strQuestion3 = Request.Form("softwareFormats").Item ' drop down list selection


dim objMail

Set objMail = Server.CreateObject("CDO.Message")
'Set objMail = CreateObject("CDONTS.NewMail")

' -- email variables --
objMail.From = Trim("feedback@avanquestusa.com")
objMail.To = Trim(strEmailTwo)
objMail.Subject = "Promotional Code for Avanquest Software Educator Perks Program"
'objMail.BodyFormat = "0" ' HTML format
objMail.TextBody = "Thank you " & Trim(strFName) & Trim(strLName) & " for submitting your application to Avanquest Software Educators Perks Program." & vbCrLf _
& vbCrLf _
& "School Information " & vbCrLf _
& vbCrLf _
& "School Name: " & Trim(strSchoolName) & vbCrLf _
& "School Address: " & Trim(strAddress) & " " & Trim(strCity) & " " & Trim(strState) & " " & Trim(strZipcode) & vbCrLf _
& Trim(strCountry) & vbCrLf _
& vbCrLf _
& "You primarily work help students in: " & Trim(strQuestion1) & vbCrLf _
& vbCrLf _
& "The most common operating system used at your school is " & Trim(strQuestion2) & vbCrLf _
& vbCrLf _
& "Most of your current school software is " & Trim(strQuestion3) & vbCrLf _
& vbCrLf _
& "These are the products I want for the classroom which I cannot find on your website or from other publishers: " & Trim(strMessage)

' -- send the email -- 
objMail.Send()

' -- clean up object
Set objMail = Nothing

' -- execute confirmation page
Response.Redirect "thankyou.asp"
%>
Reply With Quote  
Join Date: Oct 2006
Posts: 19
Reputation: doraima29 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
doraima29 doraima29 is offline Offline
Newbie Poster

Re: Is there a way to separate strings in Classic ASP

  #3  
Dec 20th, 2007
thanks, I got it. I really appreciate your help!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP Forum

All times are GMT -4. The time now is 11:16 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC