Tôi đã nâng cấp máy chủ cục bộ của mình bằng XAMPP 1.8.0 chứa Apache 2.4.2, PHP 5.4.5 và MySQL 5.5. Tôi gửi thư bằng hàm PHP mail() bằng cách chạy MercuryMail, nhưng không nhận được email nào trong hộp thư đến của tôi.
Gửi thư đang hoạt động khi tôi thử nghiệm với Mozilla Thunderbird. Và hàm mail() dường như đang hoạt động mà không có lỗi nào được đưa ra.Không có thư nào nhận được trong hộp thư đến với XAMPP 1.8.0, MercuryMail và thư()
Tôi đã kiểm tra php.ini trong đường dẫn cài đặt XAMPP của tôi D: \ xampp \ php. Tôi đã thấy điều này bên dưới
[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"
Tôi đã điều chỉnh một số kết hợp cài đặt SMTP.
Tôi nhận xét ra host và cổng
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 25
Tôi nhận xét ra sendmail_path, nhưng nó đã không làm việc. Không thể gửi thư.
; 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"
lần nữa, tôi nhận xét ra anothor sendmail_path để làm việc với 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"
Nó dường như làm việc, nhưng không có thư nhận được trong hộp thư đến. Không tìm thấy gì trong số D: \ xampp \ mailoutput
Trong nhật ký thư php (D: \ xampp \ php \ logs \ php_mail.log), tôi tìm thấy một số dòng đăng nhập có khả năng là thư đang gửi.
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]>
Tôi cũng đã cố gắng để nhận xét ra sendmail_from, nhưng không có may mắn.
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]
Mọi cấu hình tôi vẫn bị thiếu?
[Chỉnh sửa]
Máy chủ thư thủy ngân đang chạy.
Bất cứ khi nào tôi cập nhật php.ini, tôi đã khởi động lại máy chủ Apache.
Để gửi email bên ngoài, bạn cũng cần phải hủy kích hoạt "Không cho phép chuyển tiếp SMTP thư không phải cục bộ" trong cài đặt Mercury. – Krystian
@Krystian, Cảm ơn bạn đã thông tin. – Sithu
Tuyệt vời, thaks cho việc này. – Magicode