PHP邮件函数在幕后是如何工作的?

PHP邮件函数在幕后是如何工作的?,php,email,Php,Email,我在谷歌上搜索了不少,但找不到具体问题的答案 我了解mail()的语法以及编辑php.ini文件的步骤。但是,当我不提供身份验证信息时,SMTP服务器为什么会接受连接请求呢 例如,如果我想通过我的gmail帐户发送电子邮件,我必须使用我的电子邮件地址和密码登录。但是使用PHPmail()似乎可以让我完全绕过这个步骤 mail()函数在幕后是如何工作的?根据PHP函数和相关RFC的手册 并列在: “注: 以下RFC可能有用:»RFC 1896、»RFC 2045、»RFC 2046、»RFC 20

我在谷歌上搜索了不少,但找不到具体问题的答案

我了解
mail()
的语法以及编辑php.ini文件的步骤。但是,当我不提供身份验证信息时,SMTP服务器为什么会接受连接请求呢

例如,如果我想通过我的gmail帐户发送电子邮件,我必须使用我的电子邮件地址和密码登录。但是使用PHP
mail()
似乎可以让我完全绕过这个步骤


mail()
函数在幕后是如何工作的?

根据PHP函数和相关RFC的手册

并列在:

“注: 以下RFC可能有用:»RFC 1896、»RFC 2045、»RFC 2046、»RFC 2047、»RFC 2048、»RFC 2049和»RFC 2822。”

来自RFC 2049

[RFC-1421] 林恩,J.,“互联网电子产品的隐私增强” 邮件:第一部分——邮件加密和身份验证 程序”,RFC 1421,IAB IRTF PSRG,IETF PEM工作组, 1993年2月。

增强互联网电子邮件的隐私: 第一部分:消息加密和身份验证程序

1. This RFC's measures are restricted to implementation at endpoints and are amenable to integration with existing Internet mail protocols at the user agent (UA) level or above, rather than necessitating modifications to existing mail protocols or integration into the message transport system (e.g., SMTP servers). 2. The set of supported measures enhances rather than restricts user capabilities. Trusted implementations, incorporating integrity features protecting software from subversion by local users, cannot be assumed in general. No mechanisms are assumed to prevent users from sending, at their discretion, messages to which no PEM processing has been applied. In the absence of such features, it appears more feasible to provide facilities which enhance user services (e.g., by protecting and authenticating inter-user traffic) than to enforce restrictions (e.g., inter-user access control) on user actions. 3. The set of supported measures focuses on a set of functional capabilities selected to provide significant and tangible benefits to a broad user community. By concentrating on the most critical set of services, we aim to maximize the added privacy value that can be provided with a modest level of implementation effort. 1.本RFC的措施仅限于在 端点和可与现有 用户代理(UA)级别的Internet邮件协议或 而不是必须修改现有的 邮件协议或集成到消息传输中 系统(例如SMTP服务器)。 2.这套受支持的措施增强而不是限制 用户能力。受信任的实现,包括 完整性功能保护软件免受 本地用户,一般不能假定为本地用户。没有机制 假定是为了防止用户在其 自由裁量权,未对其进行PEM处理的消息 应用在没有这些特征的情况下,它显得更为重要 提供可加强用户服务的设施是可行的 (例如,通过保护和验证用户间通信) 而不是强制实施限制(例如,用户间访问 控制)对用户操作的影响。 3.这组受支持的措施侧重于一组功能性措施 选择能够提供显著和有形信息的能力 对广大用户群体的好处。通过专注于 最关键的一组服务,我们的目标是最大限度地增加 隐私价值,可通过适度的 执行工作。
这是因为
mail()
在您自己的服务器上工作,不需要验证您,而当您连接到外部源时,由于您使用的是“他们的”邮件服务器,所以需要验证。如果不是“正确”的答案,那就称之为答案。如果我上面写的内容不能让你满意,你需要这样说。否则,请阅读邮件手册和相关RFC,否则我可以在下面弹出一个答案,引用这些。您的问题与编程无关,而是核心服务器身份验证过程。@Fred。谢谢虽然这并不能让事情变得更清楚。我将设法找到相关的RFC。邮件手册没用。给我一分钟,我会在下面弹出一些东西。我知道该找什么;除了我在评论中提到的内容之外,我在下面给你们提了一些东西,更像是一个“简而言之”的答案。 1. This RFC's measures are restricted to implementation at endpoints and are amenable to integration with existing Internet mail protocols at the user agent (UA) level or above, rather than necessitating modifications to existing mail protocols or integration into the message transport system (e.g., SMTP servers). 2. The set of supported measures enhances rather than restricts user capabilities. Trusted implementations, incorporating integrity features protecting software from subversion by local users, cannot be assumed in general. No mechanisms are assumed to prevent users from sending, at their discretion, messages to which no PEM processing has been applied. In the absence of such features, it appears more feasible to provide facilities which enhance user services (e.g., by protecting and authenticating inter-user traffic) than to enforce restrictions (e.g., inter-user access control) on user actions. 3. The set of supported measures focuses on a set of functional capabilities selected to provide significant and tangible benefits to a broad user community. By concentrating on the most critical set of services, we aim to maximize the added privacy value that can be provided with a modest level of implementation effort.