Monday, March 26, 2012

tabs and line breaks lost in Outlook Express

Hi, Folks --

Not sure this is the right forum for this, but I thought I'd try.

I'm sending out emails from my ASP.NET app using the SmtpClient and MailMessage classes. Easy as pie to do this, but the problem is that the \t and \r characters that I include in the MailMessage body are ignored in Outlook Express, so I end up with a big blob of text.

This problem does not occur in Lotus Notes or when I view the emails on the Web.

Any suggestions are greatly appreciated.

Thanks,

Eric

I know outlook express automatically removes extra line breaks from messages. I'm not sure if thats what your encountering.

I'm assuming because your using \t and \r that you arent doing an html body message...is that a possibility or no?

You can try instead of using the \t and \r to use the Chr(13) and chr(20) ASCII designation for whatever language your using, unfortunatly if your using a string literal you may end up with that printed in your message.


Thanks, F.

Using \n instead of \r solved the line break problem in Outlook Express. (I still have to check this in Lotus Notes, but I don't anticipate a problem.)

I also ended up specifying:

message.BodyEncoding = System.Text.

Encoding.UTF8;

for good measure, even though this wasn't necessary for the line break issue.

As for the tabs, could not get them to work, but I'm going to avoid these anyway because the number of spaces rendered per tab is a pain to try to adjust.

Eric

0 comments:

Post a Comment