View Single Post
  #4 (permalink)  
Old July 18th, 2006, 12:38 PM
buellja buellja is offline
Registered User
Join Date: Jul 2006
Location: Cincinnati, OH, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

So, if a user enters a line break, you want to preserve it when the email is generated, right?

To do so, you need to convert Chr(13) to <BR> since you're sending an email using CDOSYS's .HTMLBody.

So, for example:

Dim strUserComments
strUserComments = Request.Form("emailComments")
If Len(strUserComments) > 1 Then
   strUserComments = Replace(strUserComments,Chr(13),"<br>")
End If
What this does is converts the carriage return character to the HTML <br> or line-break tag.

So, when calling objYourObject.HTMLBody = blah & strUserComments

the <br> will be included in the output email.

Reply With Quote