我使用包含Apache 2.4.2,PHP 5.4.5和MySQL 5.5的XAMPP 1.8.0升級了本地服務器。 我通過運行MercuryMail發送帶有PHP郵件()函數的郵件,但沒有在收件箱中收到郵件。
當我使用Mozilla Thunderbird進行測試時發送郵件正在工作。而mail()函數似乎正在工作,沒有發佈錯誤。我的XAMPP安裝路徑D:\ xampp \ php。我在下面看到這個在XAMPP 1.8.0,MercuryMail和郵件收件箱中收到郵件()
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = localhost
; smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
; sendmail_from = [email protected]
; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesD:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
; sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the D:\xampp\mailoutput folder
; sendmail_path = "D:\xampp\mailtodisk\mailtodisk.exe"
我調整了一些SMTP設置的組合。
我註釋掉主機和端口
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 25
我註釋掉sendmail_path,但沒有奏效。郵件無法發送。
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
同樣,我註釋掉anothor sendmail_path與mailToDisk
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the D:\xampp\mailoutput folder
sendmail_path = "D:\xampp\mailtodisk\mailtodisk.exe"
它似乎努力工作,但在收件箱中收到任何郵件。沒有在d發現:\ XAMPP \ mailoutput
在PHP的郵件日誌(d:\ XAMPP \ PHP \日誌\ php_mail.log),我發現這很可能說是郵件發送一些日誌行。
mail() on [D:\xampp\htdocs\....:127]: To: [email protected] -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:Sithu <[email protected]> From: Sithu <[email protected]> Reply-To: Sithu <[email protected]>
mail() on [D:\xampp\htdocs\....:127]: To: [email protected] -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:[email protected] From: [email protected] Reply-To: [email protected]
mail() on [D:\xampp\htdocs\....:127]: To: [email protected] -- Headers: MIME-Version: 1.0 Content-type: text/html; charset=text/html Return-Path:Members <[email protected]> From: Members <[email protected]> Reply-To: Members <[email protected]>
我也試着註釋掉sendmail_from,但沒有運氣。
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]
任何配置我仍然失蹤?
[編輯]
Mercury郵件服務器正在運行。
每當我更新php.ini,我重新啓動Apache服務器。
要在外部發送電子郵件,還需要在Mercury設置中禁用「不允許SMTP中繼非本地郵件」。 – Krystian
@Krystian,謝謝你的信息。 – Sithu
優秀,贊成這個。 – Magicode