没有在收件箱中收到与XAMPP 1.8.0邮件,MercuryMail和邮件()(No mail r

2019-07-02 18:48发布

我使用XAMPP 1.8.0中包含Apache 2.4.2,5.4.5 PHP和MySQL 5.5升级我的本地服务器。 我通过运行MercuryMail发送邮件使用PHP mail()函数,但在我的收件箱收到任何电子邮件。
当我和Mozilla Thunderbird中测试发送邮件的工作。 和邮件()功能似乎并没有发出错误地工作。

\ XAMPP \ PHP:我在XAMPP安装路径d检查php.ini中 。 我看到了下面这样

[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 = postmaster@localhost  

; 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: sithu@localhost.com -- Headers: MIME-Version: 1.0  Content-type: text/html; charset=text/html  Return-Path:Sithu <stk@localhost.com>  From: Sithu <stk@localhost.com>  Reply-To: Sithu <stk@localhost.com>  
mail() on [D:\xampp\htdocs\....:127]: To: test@localhost.com -- Headers: MIME-Version: 1.0  Content-type: text/html; charset=text/html  Return-Path:admin@localhost.com  From: admin@localhost.com  Reply-To: admin@localhost.com  
mail() on [D:\xampp\htdocs\....:127]: To: test@localhost.com -- Headers: MIME-Version: 1.0  Content-type: text/html; charset=text/html  Return-Path:Members <admin@localhost.com>  From: Members <admin@localhost.com>  Reply-To: Members <admin@localhost.com> 

我也试着注释掉sendmail_from,但没有运气。

; For Win32 only.  
; http://php.net/sendmail-from  
sendmail_from = postmaster@localhost  

任何配置我仍下落不明?

[编辑]
水星邮件服务器正在运行。
每当我更新php.ini中 ,我重新启动Apache服务器。

Answer 1:

我只需要配置d:\ XAMPP \ sendmail的\ sendmail.ini默认情况下,它包含的行

smtp_server=mail.mydomain.com

我不得不将其更改为

smtp_server=localhost

无需在旧版本的XAMPP的配置此。
为正确的配置[mail function]d:\ XAMPP \ PHP \ php.ini中

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

现在,我在我的收件箱接收邮件。 请注意,“d:\ XAMPP \”是我的XAMPP安装路径。



Answer 2:

确保汞邮件服务器正在运行,它不会默认运行。



Answer 3:

#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= xxxx.xxxx@gmail.com
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 = xxxx.xxxx@gmail.com

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


文章来源: No mail received in inbox with XAMPP 1.8.0, MercuryMail and mail()