Ho aggiornato il mio server locale utilizzando XAMPP 1.8.0 che contiene Apache 2.4.2, PHP 5.4.5 e MySQL 5.5. Invio mail con la funzione PHP mail() eseguendo MercuryMail, ma nessuna email ricevuta nella mia casella di posta.
L'invio di messaggi di posta elettronica funziona quando ho eseguito il test con Mozilla Thunderbird. E la funzione mail() sembra funzionare senza errori.Nessuna posta ricevuta nella posta in arrivo con XAMPP 1.8.0, MercuryMail e posta()
ho controllato php.ini nel mio XAMPP installazione percorso D: \ xampp \ php. L'ho visto sotto
[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"
Ho ottimizzato una combinazione di impostazioni SMTP.
ho commentato host e la porta
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 25
ho commentato sendmail_path, ma non ha funzionato. La posta non può essere inviata.
; 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"
Ancora una volta, ho commentato anothor sendmail_path a lavorare con 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"
Sembra di lavoro, ma non la posta ricevuto nella posta in arrivo. Non abbiamo trovato nulla in D: \ xampp \ mailoutput
in PHP log di posta (D: \ xampp \ php \ logs \ php_mail.log), ho trovato diverse linee di registro che probabilmente dicendo mail sono state inviando.
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]>
Ho anche cercato di commentare sendmail_from, ma senza fortuna.
; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = [email protected]
Qualche configurazione mi manca ancora?
[Modifica]
Il server di posta Mercury è in esecuzione.
Ogni volta che ho aggiornato php.ini, ho riavviato il server Apache.
Per l'invio di e-mail all'esterno è inoltre necessario disattivare "Non consentire l'inoltro SMTP di posta non locale" nelle impostazioni di Mercury. – Krystian
@ Krystian, Grazie per le tue informazioni. – Sithu
Eccellente, grazie per questo. – Magicode