D:\php\sendmail\。D:\php)。[mail function]
;SMTP = localhost
;smtp_port = 25
;sendmail_from = me@example.com
sendmail_path = "D:\php\sendmail\sendmail.exe -t"
;mail.force_extra_parameters =
SMTP、smtp_port。sendmail_path 指向 sendmail.exe -t (-t 表示從郵件標頭解析收件人)。smtp_server=smtp.qq.com
smtp_port=465
auth_username=your_email@qq.com
auth_password=your_auth_code
force_sender=your_email@qq.com
; 啟用 SSL (465 埠) 或 TLS (587 埠)
; auto = use SSL for port 465, otherwise try to use TLS
auto
auth_password:QQ 郵箱需填「授權碼」而非登入密碼;163/新浪同理。force_sender:強制發件人地址,防止被拒收。sendmail.exe 內部會調用 cmd.exe,需授予 IIS 執行身分 (IUSR、IIS_IUSRS、NETWORK SERVICE 或應用程式池身分) 對 C:\Windows\System32\cmd.exe 的 **讀取與執行** 權限,否則報錯:
Warning: mail() [function.mail]: Could not execute mail delivery program
disable_functions 禁用了 mail → 移除禁用。