Windows 10,XAMMP-WINDOWS-X64-7.3.6-0-VC15,公司局域网。
1. XAMMP 中集成了 Mercury 邮件服务,在主控制面板中启动 Mercury,点击相应的 Admin 按钮打开 Mercury 控制面板,进入Configuration / Mercury Core Module Connfiguration / General 中将 ”Internet name for this system“ 填写为 ”localhost“;在Configuration / Mercury SMTP Server / Connection Control 中确认 “Do not permit SMTP relaying of non-local mail” 项未被勾选;在 Congfiguration / Protocol Modules 中确认 “MercuryE SMTP end-to-end delivery client” 项被勾选。重启 Mercury。
2. 打开 php.ini,在 [mail function] 部分改写以下字段,记得去掉字段前原有的分号:
SMTP = localhost
smtp_port = 25
sendmail_from = anything@anything.anything
重启 Apache。
3. sendmail_from 项可随便填写,但必须符合 Email 格式;也可不写,但若不写则在 mail() 函数中必须有 ‘From:anything@anything.anything’ 参数项,否则邮件无法送出。
完成以上配置后使用个人QQ邮箱测试成功。仅适用于使用本地电脑向外发送邮件,接受邮件尚未涉及。
posted on
浙公网安备 33010602011771号