展望自动清洗我换行和搞砸了我的电子邮件格式 [英] Outlook autocleaning my line breaks and screwing up my email format

查看:718
本文介绍了展望自动清洗我换行和搞砸了我的电子邮件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要送用的dotnet框架的电子邮件。下面是我用来创建消息的模板:

I'm sending an email using the dotnet framework. Here is the template that I'm using to create the message:

Date of Hire: %HireDate%
Annual Salary: %AnnualIncome%
Reason for Request: %ReasonForRequest%

Name of Voluntary Employee: %FirstName% %LastName%
Total Coverage Applied For:  %EECoverageAmount%
Guaranteed Coverage Portion: %GICoveragePortion%
Amount Subject to Medical Evident: %GIOverage%

当接收到Outlook中的邮件,前景告诉我此消息中多余的换行符被拆除。而消息显示是这样的:

When the messages is received in outlook, outlook tells me "Extra line breaks in this message were removed". And the message displays like this:

Date of Hire: 9/28/2001
Annual Salary: $100,000
Reason for Request: New Hire

Name of Voluntary Employee: Ronald Weasley Total Coverage Applied For:  $500,000 Guaranteed Coverage Portion: $300,000.00 Amount Subject to Medical Evident: $200,000

请注意如何在名称后的Outlook错误地删除需要换行,EECoverageAmount,等等...

Note how Outlook incorrectly removes needed line breaks after the name, EECoverageAmount, etc...

这是非常重要的电子邮件recepients得到正确格式的电子邮件,而且我必须假设,其中一些使用Outlook 2003中我也不能假设他们会知道足够设置截止的自动清洗功能来获取该消息格式正常。

It's important for the email recepients to get a correctly formatted email, and I have to assume that some of them use outlook 2003. I also can't assume they will know enough to shutoff the autoclean feature to get the message to format properly.

我认为在其他邮件客户端这些消息,他们正确显示

I have viewed these messages in other mail clients and they display correctly

一些更多的信息:

  • 在我使用UTF-8 BodyEncoding(msg.BodyEncoding = System.Text.Encoding.UTF8)
  • 的msg.Body正在从一个UTF-8 EN codeD读取文本文件,每行以一个CRLF。

问: 如何更改邮件的格式,以避免这个问题?

Question: How do I change the format of the message to avoid this problem?

推荐答案

开始与2位和Outlook每个行会被骗让您的格式。

Start every line with 2 spaces and outlook will be "tricked" into keeping your formatting.

所以,改变

Date of Hire: %HireDate%
Annual Salary: %AnnualIncome%
Reason for Request: %ReasonForRequest%

Name of Voluntary Employee: %FirstName% %LastName%
Total Coverage Applied For:  %EECoverageAmount%
Guaranteed Coverage Portion: %GICoveragePortion%
Amount Subject to Medical Evident: %GIOverage%

  Date of Hire: %HireDate%
  Annual Salary: %AnnualIncome%
  Reason for Request: %ReasonForRequest%

  Name of Voluntary Employee: %FirstName% %LastName%
  Total Coverage Applied For:  %EECoverageAmount%
  Guaranteed Coverage Portion: %GICoveragePortion%
  Amount Subject to Medical Evident: %GIOverage%
^^ <--- Two extra spaces at the start of every line

下面是<一href="http://www.masternewmedia.org/newsletter_publishing/newsletter_formatting/remove_line_breaks_issue_Microsoft_Outlook_2003_when_publishing_text_newsletters_20051217.htm">article我发现研究这个问题,这将进入比我的回答更深入一点的时候。

Here is the article I found when researching this problem which goes into a little more depth than my answer.

这篇关于展望自动清洗我换行和搞砸了我的电子邮件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆