If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Replacing carriage return by BR tag before to send an email

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-09-04, 07:50
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Replacing carriage return by BR tag before to send an email

Hi,
I have a text area on page 1 which is use for the body of the email sent on page 2
On page 2 i collect the data entered by the user (ASP Javascript), replace teh carriage returns by a BR tag and send the email.
The carriage returns seem to be replaced fine when checking on a page, however on the email where the BR tag should be it is not adding a break line, as well as that it is removing part of the text sent, can't figure it out.
I am using Jmail to send the email set as text/html
Here is the code i use to replace the \n:
// replace CR/LFs with BRs
function ReplaceCRLF(str) {
re = /\n/g;
return str.replace(re,"<BR>");
}


Thanking you for any help

Oli
Reply With Quote
  #2 (permalink)  
Old 09-10-04, 12:16
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
And you are encoding the entire email with <html> and <body> tags?
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
  #3 (permalink)  
Old 09-11-04, 06:53
oliflorence oliflorence is offline
Registered User
 
Join Date: Aug 2004
Posts: 96
Yes the entire email contains body tags and the all lot, i am just incorporating the data coming from the form in a p tag
Reply With Quote
  #4 (permalink)  
Old 09-12-04, 02:38
Seppuku Seppuku is offline
Useless...
 
Join Date: Jul 2003
Location: SoCal
Posts: 721
I'd bet that your <BR> tag is not actually being replaced. I'd use the Replace function of ASP to replace the carriage return and line feed, not JavaScript.

myVar = Replace(Request.Form("textField"), vbCRLF, "<BR>")
__________________
That which does not kill me postpones the inevitable.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On