ASP Email

Lukster's picture

They have: 64 posts

Joined: Sep 2001

Heyas all,

Ive basically taken this code from a friend and am editing it for a clients website. The problem is when it sends the email, each response is after each other. eg.

An enquiry has been received from the Fibremotive website. Here are the details: Name = Lucas Home Phone = 9889 6657 Make = Mitsubishi Email Address = [email protected] Phone = Year = 1996 The enquirer also left this comment ... I want the Evo 7 kit!, how much?

How do i insert a line break in the asp code below??

Dim txtBody
txtBody = txtBody & "An enquiry has been received from the Fibremotive website." & vbcrlf & vbcrlf
txtBody = txtBody & "Here are the details:" & vbcrlf
txtBody = txtBody & "Name = " & varName & vbcrlf
txtBody = txtBody & "Home Phone = " & varAddress & vbcrlf
txtBody = txtBody & "Make = " & varPostcode & vbcrlf
txtBody = txtBody & "Email Address = " & varEmail & vbcrlf
txtBody = txtBody & "Phone = " & varTelephone & vbcrlf
txtBody = txtBody & "Year = " & varFax & vbcrlf & vbcrlf
txtBody = txtBody & "------------------------------------" & vbcrlf & vbcrlf

Thanks in advance

"Whenever you do a thing, act as if all the world were watching."

Online Data Backup? I'd like to see that!

They have: 11 posts

Joined: Jan 2003

Quote: Originally posted by Lukster

Dim txtBody
txtBody = txtBody & "An enquiry has been received from the Fibremotive website." & vbcrlf & vbcrlf
txtBody = txtBody & "Here are the details:" & vbcrlf
txtBody = txtBody & "Name = " & varName & vbcrlf
txtBody = txtBody & "Home Phone = " & varAddress & vbcrlf
txtBody = txtBody & "Make = " & varPostcode & vbcrlf
txtBody = txtBody & "Email Address = " & varEmail & vbcrlf
txtBody = txtBody & "Phone = " & varTelephone & vbcrlf
txtBody = txtBody & "Year = " & varFax & vbcrlf & vbcrlf
txtBody = txtBody & "------------------------------------" & vbcrlf & vbcrlf

Thanks in advance [/B]

Everything looks fine. The VBCRLF's are your line breaks. VBCRLF means, IIRC, Visual Basic Carriage Return Line Feed, or something like that. What kind of mail object are you using? CDONTS? SMTPSVG? More code would be helpful as I know some asp mailer objects get finicky with new lines.

He has: 52 posts

Joined: Feb 2003

do you mean insert a into the email itself?

They have: 5,633 posts

Joined: Jan 1970

VBCRLF is your line break. For all my emails (done with CDONTS), VBCRLF after a line inserts a break. Sorta like hitting return. But if you repeat it, it acts just like you kept hitting return.

For example:

body = "Hello" & VBCRLF
body = body & "This is a test." & VBCRLF & VBCRLF
body = body & "Of line breaks in emails."

Would return:

Hello
This is a test.

Of line breaks in emails.

I hope that helped!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.