gpt4 book ai didi

c# - 换行的电子邮件中的双倍小数点

转载 作者:行者123 更新时间:2023-11-30 12:28:08 25 4
gpt4 key购买 nike

当我使用 .NET System.Net.Mail.MailMessage 类发送 HTML 电子邮件(实际上只是生成 .eml 文件而不是发送)时,它似乎添加了加法小数指向我的一些数字。

它只是在数字被分割成一个新行并且新行的第一个字符本来是一个点时才添加额外的小数点。

输入:

[snip]27.50[snip]137.50[snip]

输出:

[snip]27.=
50[snip]=
[snip]137=
..50[snip]

在 Outlook 中打开时,第一个数字输出为 27.00,但第二个(可以理解)输出 137..50(小数点太多!)

我知道 equals 是一个“软换行符”。额外的 . 有语法吗?

为什么输出2个点?我可以阻止它这样做吗?

非片段输出:

<tr>=0D=0A          <td>=
Units</td><td>Standard Rate</td><td></td><td>25.00</td><td>27.=
50</td><td>25.00</td><td>625.00</td><td>687.50</td>=0D=0A </tr><=
tr>=0D=0A <td>Timesheet Units</td><td>Standard Rate</td><td></t=
d><td>25.00</td><td>27.50</td><td>5.00</td><td>125.00</td><td>137=
..50</td>=0D=0A </tr>

最佳答案

我怀疑您只是遇到了一个事实,即一行开头的句点用于终止邮件。

来自 RFC 2821第 4.5.2 节:

4.5.2 Transparency

Without some provision for data transparency, the character sequence "." ends the mail text and cannot be sent by the user. In general, users are not aware of such "forbidden" sequences. To allow all user composed text to be transmitted transparently, the following procedures are used:

  • Before sending a line of mail text, the SMTP client checks the first character of the line. If it is a period, one additional period is inserted at the beginning of the line.
  • When a line of mail text is received by the SMTP server, it checks the line. If the line is composed of a single period, it is treated as the end of mail indicator. If the first character is a period and there are other characters on the line, the first character is deleted.

换句话说,我怀疑当邮件实际发送时,收件人只会看到一个点。虽然不清楚为什么 Outlook 会在这里做错事...

关于c# - 换行的电子邮件中的双倍小数点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22959352/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com