Formatting a text email using CDO and Javascript

Hello,

I'm tring to format a multi-line text email being sent from my asp page using javascript. How would I do this? I tried using '& vbclr', but it's not working.

This is my code..

var objMail = Server.CreateObject("CDO.Message");
      objMail.From = "safety@xxxxx.com";
      objMail.To = Email;
        objMail.Subject = "Earthquake Survey Confirmation";
      objMail.TextBody = "Hello  " + FirstName + ",";   /////***** need to start a second line here***********////
      objMail.Send();
      objMail = null;
%>
jkobzAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jmelikaCommented:
&VbClr is a VB thing (ASP).  For Javascript, use /n

JM
0
jmelikaCommented:
I'm not sure if it's Javascript though.  Your code looks very much ASP to me.  Try this:

var objMail = Server.CreateObject("CDO.Message");
     objMail.From = "safety@xxxxx.com";
     objMail.To = Email;
        objMail.Subject = "Earthquake Survey Confirmation";
     objMail.TextBody = "Hello  " + FirstName + ","
     objMail.TextBody = objMail.TextBody & VbCrLf & "Your new lines"
     objMail.Send();
     objMail = null;
0
jmelikaCommented:
And by the way, I made a typo in my first post.  Javascript line feed is \n and not /n

JM
0
jkobzAuthor Commented:
Hi JM...

I tried that...here is my exact code...and this is what i get

code..

<%@ LANGUAGE = JavaScript%>

<%

//Request Data from PDF
var FirstName        = Request.form("FirstName")
var LastName         = Request.form("LastName")
var Email            = Request.form("Email")
var Ext              = Request.form("Ext")
var OfficeNumber     = Request.form("OfficeNumber")
var FlatPanel        = Request.form("FlatPanel")
var SmallMonitor     = Request.form("SmallMonitor")
var SevMonitor       = Request.form("SevMonitor")
var MonitorStand     = Request.form("MonitorStand")
var SmallPrinter     = Request.form("SmallPrinter")
var LargePrinter     = Request.form("LargePrinter")
var FlatbedScanner   = Request.form("FlatbedScanner")
var SelfUnits        = Request.form("SelfUnits")
var Bookcases        = Request.form("Bookcases")
var MiscEquipment    = Request.form("MiscEquipment")
var Comments         = Request.form("Comments")

// Email Information


var objMail = Server.CreateObject("CDO.Message");
      objMail.From = "safety@adobe.com";
      objMail.To = Email;
        objMail.Subject = "Earthquake Survey Confirmation";
      objMail.TextBody = "Hello  " + FirstName + ","
           objMail.TextBody = objMail.TextBody & VbCrLf & "Your new lines"

      objMail.Send();
      objMail = null;
%>



error i get in browser

Error Type:
Microsoft JScript runtime (0x800A1391)
'VbCrLf' is undefined
/orderconfirm.asp, line 33


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1)

Page:
POST 83 bytes to /orderconfirm.asp

POST Data:
Email=jkobz%40adobe.com&Ext=987&FirstName=ss&LastName=ss&OfficeNumber=98797&Submit=

Time:
Monday, November 29, 2004, 7:41:22 PM


More information:
0
DiggaCommented:
Try changing this:
objMail.TextBody = objMail.TextBody & VbCrLf & "Your new lines"

to this:
objMail.TextBody = objMail.TextBody + VbCrLf + "Your new lines"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.