Java SMTP将邮件内容中的句号视为最后一行
我将用户的输入作为电子邮件内容发送到文本框中,并通过SMTP通过套接字发送。我用Java做这个。然而,问题是当用户输入诸如Java SMTP将邮件内容中的句号视为最后一行,java,sockets,smtp,Java,Sockets,Smtp,我将用户的输入作为电子邮件内容发送到文本框中,并通过SMTP通过套接字发送。我用Java做这个。然而,问题是当用户输入诸如 <CLRF> . <CLRF> Other content blah blah blah... . 其他内容一派胡言。。。 SMTP将该句号作为最后一行,然后它下面的内容将不会被传递!我如何才能让SMTP知道,句号是电子邮件内容的一部分,而不是电子邮件已结束的表示?解决了这个确切的问题: 如果不提供数据透明度,字符序列“.”将结束邮件文本,用户
<CLRF>
.
<CLRF>
Other content blah blah blah...
.
其他内容一派胡言。。。
SMTP将该句号作为最后一行,然后它下面的内容将不会被传递!我如何才能让SMTP知道,句号是电子邮件内容的一部分,而不是电子邮件已结束的表示?解决了这个确切的问题:
如果不提供数据透明度,字符序列“.”将结束邮件文本,用户无法发送。一般来说,用户不知道这样的“禁止”序列。为了使所有用户编写的文本能够透明地传输,使用了以下步骤
只需再加一个句号 4.5.2透明度
Without some provision for data transparency, the character sequence
"<CRLF>.<CRLF>" 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.
在不提供数据透明度的情况下,字符序列
“.”结束邮件文本,用户无法发送。
一般来说,用户不知道这样的“禁止”序列。到
允许透明地传输所有用户编写的文本
使用以下程序:
-在发送一行邮件文本之前,SMTP客户端将检查
行的第一个字符。如果是一个周期,则另加一个周期
句点插入行的开头。
-当SMTP服务器收到一行邮件文本时,它会进行检查
排队。如果该行由单个周期组成,则为
视为邮件结束指示器。如果第一个字符是
句号,行中还有其他字符,第一个
字符被删除。
有关详细信息,请参阅。33秒决胜。不错。:)这就是为什么在完成键入答案之前保存(: