gpt4 book ai didi

smtp - HELO localhost 中 'localhost' 的意义

转载 作者:行者123 更新时间:2023-12-05 00:04:48 25 4
gpt4 key购买 nike

在 SMTP 中,HELO 命令之后应该是什么,它有什么作用?

我在我的应用程序中发送电子邮件,我想知道我是否应该使用 localhost、发件人地址的域名 (me@example.com)、应用程序服务器的域名(发送电子邮件的位置) ) 或者是其他东西。

最佳答案

HELO 后面的参数应该标识发送邮件的系统。因此,您将为发送机器使用可外部寻址的 DNS 名称。

不要使用 localhost因为很多垃圾邮件软件都会这样做,您的电子邮件将被标记为垃圾邮件。

来自 RFC 2821 :

4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO)

These commands are used to identify the SMTP client to the SMTP server. The argument field contains the fully-qualified domain name of the SMTP client if one is available.



我通常会建议您使用真正的 MTA,并将您的电子邮件交给 MTA 以进行最终交付。这样您就不必重新发明 SMTP 协议(protocol)的实现,这非常容易出错。

关于smtp - HELO localhost 中 'localhost' 的意义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5294478/

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