来自PHP项目devnexen的回信

我的诉求:SMTP在Windows上无法使用mail函数发邮件,请剔除这个模块 (Issue #25459)

谁有能力来重写一下PHP mail 模块吧!

devnexen left a comment (php/php-src#25459)

So I asked chatgpt to help on this :)

The issue template was left empty, so there is no reproducer or error message to look at.

On Windows, mail() uses a minimal built-in SMTP client: it does not support SMTP authentication or TLS (STARTTLS / SMTPS). Most mail providers require both, so mail() can only deliver through a relay that accepts unauthenticated connections (for example a local MTA on localhost:25). This is a known limitation rather than a bug.

For sending through a provider, please use a library such as PHPMailer or Symfony Mailer, which support authentication and encryption.

Removing mail() on Windows would be a backward compatibility break and would need to go through the RFC process (PHP: rfc:howto), so it can't be handled as a bug report. Closing for now. If you get a specific warning from mail() against a server that does not require authentication, feel free to reopen with the exact message and your SMTP/smtp_port/sendmail_from settings.

谢谢反馈。Windows 上的 mail() 使用内置的简易 SMTP 客户端,不支持 SMTP 认证和 TLS 加密,因此无法直接通过需要认证的邮件服务商发送邮件。这是已知限制,不是 bug。建议使用 PHPMailer 或 Symfony Mailer。移除该功能属于不兼容变更,需要走 RFC 流程。

相关推荐
阿俊-全栈开发2 小时前
扩展设计解析:LikeShop Go 版商城营销活动的插件化扩展设计思路
开发语言·微服务·golang·likeshop·likeshop源码
干啥啥不行,bug第一名2 小时前
EAFNOSUPPORT、EPROTOTYPE、EOPNOTSUPP:socket 的三层参数没有对齐
开发语言·php
我要见SA姐13 小时前
用生活化类比当钥匙,一键打开 C++ 入门大门
java·开发语言·c++
1024奇点3 小时前
第四篇 第 03 课
开发语言·ide·后端
大彼方..4 小时前
CSDN-02-开发环境介绍与安装
c语言·开发语言·stm32
BK贝壳5 小时前
初始化一亿个全 True 或全 False:bool-hybrid-array 的 TruesArray/FalsesArray 占位构造本机实测
开发语言·数据结构·python·性能优化·numpy
L-影5 小时前
HashMap详解-上篇
java·开发语言·spring·hashmap
郝学胜-神的一滴5 小时前
Effective STL 条款 17:用 swap 技巧去掉多余容量
c语言·开发语言·数据结构·c++·算法·rpc
摇滚侠6 小时前
《On Java 中文版 基础卷》阅读笔记 集合 24
java·开发语言·笔记
随流寻影7 小时前
利用 C++ 实现快速排序及三种优化
开发语言·c++