Outlook 自动清理我的换行符并弄乱我的电子邮件格式 [英] Outlook autocleaning my line breaks and screwing up my email format
问题描述
我正在使用 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 中收到邮件时,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...
电子邮件收件人获得格式正确的电子邮件很重要,我必须假设他们中的一些人使用 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)
- 正在从 UTF-8 编码的文本文件中读取 msg.Body,每行都以 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
这是我在研究这篇文章时发现的问题比我的回答更深入一点.
Here is the article I found when researching this problem which goes into a little more depth than my answer.
这篇关于Outlook 自动清理我的换行符并弄乱我的电子邮件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!