•
•
•
•
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
![]() |
•
•
Join Date: Oct 2006
Posts: 19
Reputation:
Rep Power: 2
Solved Threads: 0
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.
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.
•
•
Join Date: Dec 2007
Posts: 75
Reputation:
Rep Power: 1
Solved Threads: 10
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"
%>![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: ASP & VB and Unterminated String Constant
- Next Thread: Upload .PDF files into MySQL using plain ASP


Linear Mode