2012-10-27 7 views
6

Ich aktualisierte meinen lokalen Server mit XAMPP 1.8.0, die Apache 2.4.2, PHP 5.4.5 und MySQL 5.5 enthält. Ich sende E-Mails mit PHP mail() -Funktion durch Ausführen von MercuryMail, aber keine E-Mails in meinem Posteingang erhalten.
Das Senden von Mails funktioniert, wenn ich mit Mozilla Thunderbird getestet habe. Und die mail() Funktion scheint mit keinem ausgegebenen Fehler zu funktionieren.Keine Post im Posteingang mit XAMPP 1.8.0, MercuryMail und mail()

geprüft I php.ini in meinem XAMPP Installationspfad D: \ xampp \ php. Ich sah dies unter

[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" 

Ich zwickte einige Kombination von SMTP-Einstellungen.
bemerkte ich aus Host und Port

; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury 
SMTP = localhost 
smtp_port = 25 

ich aus sendmail_path kommentiert, aber es hat nicht funktioniert. Mail konnte nicht gesendet werden.

; 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" 

Wieder bemerkte ich anothor sendmail_path heraus mit mailToDisk arbeiten

; 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" 

Es scheint zu arbeiten, aber keine E-Mail im Posteingang empfangen. Nichts in D gefunden: \ xampp \ mailoutput

In PHP-Mail-Protokoll (D: \ xampp \ php \ logs \ php_mail.log), fand ich mehrere Protokollzeilen, die wahrscheinlich sagen Mails sendeten.

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]> 

Ich habe auch versucht sendmail_from, aber kein Glück Kommentar aus.

; For Win32 only. 
; http://php.net/sendmail-from 
sendmail_from = [email protected] 

Jede Konfiguration, die ich noch vermisse?

[Bearbeiten]
Mercury Mail-Server läuft.
Immer wenn ich php.ini aktualisierte, startete ich den Apache-Server neu.

Antwort

9

Ich brauche nur D zu konfigurieren: \ xampp \ sendmail \ sendmail.ini standardmäßig es die Zeile enthält

smtp_server=mail.mydomain.com 

ich es

smtp_server=localhost 
ändern musste

Keine Notwendigkeit, dies in den älteren Versionen von XAMPP zu konfigurieren.
Die korrekte Konfiguration für [mail function] in D: \ xampp \ php \ php. ini ist

; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury 
SMTP = 127.0.0.1 
smtp_port = 25 

; 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" 

Nun, ich Mails in meinem Posteingang empfangen. Bitte beachten Sie, dass "D: \ xampp \" mein XAMPP-Installationspfad ist.

+2

Zum Senden von E-Mail-Nachrichten außerhalb müssen Sie in den Mercury-Einstellungen auch "SMTP-Weiterleitung von nicht lokalen E-Mails nicht zulassen" deaktivieren. – Krystian

+0

@Krystian, Danke für Ihre Infos. – Sithu

+1

Ausgezeichnet, thaks dafür. – Magicode

0

Stellen Sie sicher, dass der Quecksilber-Mail-Server ausgeführt wird und nicht standardmäßig ausgeführt wird.

0
#GMAIL mit XAMPP 1.8.1 und sendmail 
[CODE] 
[sendmail] 
; HOTMAIL 
smtp_server=smtp.gmail.com 
smtp_port=25 
smtp_ssl=tls 
tls_certcheck off 
error_logfile=error.log 
debug_logfile=debug.log 
auth_username= [email protected] 
auth_password=xxxxxxx 


this settings in php.ini 
[mail function] 
    ; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury 
    ; SMTP = smtp.gmail.com 
    ; 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 filesC:\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 = "\"C:\sendmail\sendmail.exe\" -t" 

    ; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder 
    ;sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe" 

    ; Force the addition of the specified parameters to be passed as extra parameters 
    ; to the sendmail binary. These parameters will always replace the value of 
    ; the 5th parameter to mail(), even in safe mode. 
    ;mail.force_extra_parameters = 

    ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 
    mail.add_x_header = Off 

    ; Log all mail() calls including the full path of the script, line #, to address and headers 
    mail.log = "C:\xampp\php\logs\php_mail.log"