来自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 流程。

相关推荐
FRing0330 分钟前
vue2干货总结10(json-server、vant-ui、postcss插件、axios二次封装、图形验证码、toast轻提示)
开发语言·前端·vue.js·ui·json·vue2·postcss
我是大猴子1 小时前
分析sss
开发语言
geats人山人海1 小时前
现代c++4.1
java·开发语言·c++
布莱克6051 小时前
Swift 字符串详解:从基础用法到性能与最佳实践
服务器·开发语言·ssh·字符串·swift
饿了吃洗衣凝珠2 小时前
SELinux
服务器·开发语言·php
蜗牛一步步往上爬3 小时前
第四章 更多的bash shell命令
linux·开发语言·bash
普通人63 小时前
PHP多维数组排序完全指南
开发语言·php·1024程序员节
starzy199013 小时前
深入理解Scala隐式类:扩展方法机制
开发语言·人工智能·scala
M--Y14 小时前
LangGraph 工作流模式
开发语言·javascript·python·langchain·大模型·llm·langgraph