且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

XAMPP 邮件不适用于 PHP mail() 函数

更新时间:2023-02-23 16:14:27

你必须 配置与 xampp 捆绑的水星服务器 以实际传递/中继邮件.

You would have to configure the mercury server bundled with xampp to actually deliver/relay the mails.

但我建议你使用 SwiftMailer 之类的东西,而不是 php 的 mail() 函数.

But I suggest you use something like SwiftMailer instead of php's mail() function.

还有第三个选项.php/win32 内置的 mini-smtp-client 不能做认证.因此你不能简单地把 SMTP=mail.gmail.com;smtp_port=25 在您的 php.ini 中.但是您可以设置 sendmail_path 并指向可以中继的应用程序向另一个 smtp 服务器发送消息(包括身份验证),例如假发送邮件.
(但我还是建议使用 swiftmailer)

edit: there is a third option. The mini-smtp-client built into php/win32 can't do authentication. Therefore you can't simply put SMTP=mail.gmail.com; smtp_port=25 in your php.ini. But you can set sendmail_path and point to an application that can relay the message to another smtp server (including authentication), e.g. fake sendmail.
(But I still suggest swiftmailer)