Home | Advertising Info66 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: trying to fix email script A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
noel
Newbie
Newbie


Joined: March/17/2005
Online Status: Offline
Info: 1
Added: March/17/2005 at 10:25pm | IP Logged Quote noel

Hello,
     Where I work, we have a online form that an asp script converts to an email. The problem with this script is that when you open an email that came from this script, the text appears as one long string, no line breaks.  If you click "view source", the proper format is seen, with line breaks where they should be. A sample of how the text string is put together follows.

strBody = strBody & "First Name: " & Request.Form("firstname") & vbCrLf

I have been told that the vbCrLf is what is making the line breaks in the "view source". I would like to fix this so I don't have to "view source" each email. I would like to add something like "\n" to get the proper line breaks  when viewing the message normally.  Would it be as easy as adding  "\n" to  the strBody staements, like:

 strBody = strBody & "First Name: " & Request.Form("firstname") &  \n

Or do I need to use something else?

Thank you
Back to Top View noel's Profile Search for other info by noel
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: March/18/2005 at 12:50pm | IP Logged Quote cwilliams

you're most likely sending the emails in html format so the vbCrlf only  adds line breaks when you view the html source as you said

so you need to do something like this

strBody = strBody & "First Name: " & Request.Form("firstname") & vbCrLf & "<br>"

Basically an html line break is inserted (not a javascipt /n which is totally not going to work)

I'd leave the vbCrlf line breaks there so the source still is readable but they can go if you dont want them there

Here is some additional info on various string constants in vbscript

Constant Value Description
vbCr Chr(13) Carriage return
vbCrLf Chr(13) & Chr(10) Carriage return–linefeed combination
vbFormFeed Chr(10) Form feed; not useful in Microsoft Windows
vbLf Chr(10) Line feed
vbNewLine Chr(13) & Chr(10) or Chr(10) Platform-specific newline character; whatever is appropriate for the platform
vbNullChar Chr(0) Character having the value 0
vbNullString String having value 0 Not the same a zero-length string (""); used for calling external procedures
vbTab Chr(9) Horizontal tab
vbVerticalTab Chr(11) Vertical tab; not useful in Microsoft Windows
 

 



Edited by cwilliams on March/18/2005 at 6:22pm


__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com