PC Review


Reply
Thread Tools Rate Thread

CDO Mail Formatting

 
 
Ed Richter
Guest
Posts: n/a
 
      29th Nov 2005
I have a mail program that allows users to compose an email message in a text window, then when you click on a button to send, it goes to the next page and via an ASP script sends the message out to everyone on a distribution list. Everything was working great.

Then recently I converted the email to an html formatted message as there was some formatting that I wanted to use; bold in certain fields, italics other places, a more tabular layout by using tables, etc. All of the formatting and sending of the message again worked fine.

The only problem I seem to now have though is when you type anything in the message window and skip lines for paragraph breaks, when sending the message, all extra white space is eliminated except skipping one space between words. Is there a way I can have message sent using html mail, but not lose spacing? Seems that wasn't a problem prior when message was being sent as plain text??
 
Reply With Quote
 
 
 
 
p c
Guest
Posts: n/a
 
      29th Nov 2005
An email message in HTML format is essentially a web page page displayed
by your email client. In HTML, carriage returns are treated as the space
character, and all extra space characters (including CRs) found in a
series are displayed as a single space character.

If you want to display extra space, you will need to include the space
entity " " (without quotes). If you want lines, you will need to
insert the line break tag "<br>". (Some HTML automatically include a
separation line at the end, but you usually enter pure text through forms.)

Now to answer your question, in the processing page, include in the code
a function to convert CR to BR tags and then run the text thru it before
you send it to your mail routine.

here's a function

Function showTextCrLf(OriginalString)
'replaces vbCrLf codes with <br>
'Add to databases as is. Use to replace retreived txt for HTML
originalString=originalString & ""
IF originalString ="" then
showTextCrLf= ""
ELSE
showTextCrLf= Replace(OriginalString, vbCRLF, "<br>")
End if
End Function

--
Regards,
PC

Ed Richter wrote:
> I have a mail program that allows users to compose an email message in a
> text window, then when you click on a button to send, it goes to the
> next page and via an ASP script sends the message out to everyone on a
> distribution list. Everything was working great.
>
> Then recently I converted the email to an html formatted message as
> there was some formatting that I wanted to use; bold in certain fields,
> italics other places, a more tabular layout by using tables, etc. All
> of the formatting and sending of the message again worked fine.
>
> The only problem I seem to now have though is when you type anything in
> the message window and skip lines for paragraph breaks, when sending the
> message, all extra white space is eliminated except skipping one space
> between words. Is there a way I can have message sent using html mail,
> but not lose spacing? Seems that wasn't a problem prior when message
> was being sent as plain text??

 
Reply With Quote
 
Ed_R
Guest
Posts: n/a
 
      29th Nov 2005
OK thanks, will give it a try. So what this function does then is if
it sees a plain single space as in between words, it just leaves it as
a plain single space. [IF originalString ="" then showTextCrLf= "" ]
But if it sees the CR charactor, it will replace that with the br?
[ELSE showTextCrLf= Replace(OriginalString, vbCRLF, "<br>")]

Just to clarify one point, in your function above,
[showTextCrLf(OriginalString)]you used an uppercase "O" But then
within the function you used lowercase "o"
[originalString=originalString & "" ] Is there any significance
between using the two, or was that just by accident?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
E-mail formatting Fiona Yorke-Saville Microsoft Outlook Discussion 0 21st Aug 2009 12:06 PM
Question on system.mail.net and formatting mail body Scooby Dog Microsoft VB .NET 8 27th May 2009 04:51 PM
Question on system.mail.net and formatting mail body Scooby Dog Microsoft VB .NET 0 22nd May 2009 08:50 PM
Formatting of mail body and accessing mail signature Senapathy Microsoft Outlook Program Addins 1 11th Mar 2005 01:04 PM
mail formatting =?Utf-8?B?S2VsbHk=?= Microsoft Outlook Discussion 0 25th Oct 2004 04:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:16 PM.