Ahe*_*eho 112 .net outlook smtp utf-8
我正在使用dotnet框架发送电子邮件.这是我用来创建消息的模板:
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%
Run Code Online (Sandbox Code Playgroud)
在Outlook中收到消息时,outlook告诉我"此消息中的额外换行符已被删除".消息显示如下:
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
Run Code Online (Sandbox Code Playgroud)
请注意Outlook如何在名称,EECoverageAmount等之后错误地删除所需的换行符...
对于电子邮件接收者来说,获取格式正确的电子邮件非常重要,我必须假设其中一些使用outlook 2003.我也不能假设他们知道足以关闭autoclean功能以使消息正确格式化.
我在其他邮件客户端中查看了这些邮件并正确显示
更多信息:
问题:如何更改邮件格式以避免此问题?
Jim*_*vis 124
您还可以在行的末尾插入制表符(就在CR LF之前).这个额外的空白区域将位于该行的末尾,因此对用户不可见.您可能更喜欢这个必须在左侧插入空格.请注意,单个空间是不够的(虽然可能有多个空格会有所帮助,但我不知道.)
Ale*_*x B 94
以2个空格开始每一行,Outlook将被"欺骗"以保持格式.
所以改变
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%
Run Code Online (Sandbox Code Playgroud)
至
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
Run Code Online (Sandbox Code Playgroud)
以下是我在研究这个问题时发现的文章,这个文章比我的答案更深入.
DHo*_*out 26
这个答案是关于如何从Outlook客户端"禁用"该功能.
仅供参考:我使用的是Outlook 2007
我总是比较幸运地将电子邮件格式化为 html。您可能仍然遇到必须将客户端设置为允许 html 格式的最终用户问题,但他们通常对此更熟悉,因为很多电子邮件都是 html 格式的。添加 html 标签还需要做更多的工作,但最终结果更加可控。
@ephemient 还建议:以 HTML 和纯文本形式发送。好的客户端会显示后者,Outlook会显示前者,每个人都很高兴(除了必须做更多工作的程序员)。
| 归档时间: |
|
| 查看次数: |
54612 次 |
| 最近记录: |