2015-11-05 95 views
2

我一直在OS X 10.9-10.11版本(Mavericks to El Capitan)上运行AMPPS(Softaculous AMPPS),并且从未必须配置任何电子邮件设置才能使PHP mail()函数工作。OS X上的AMPPS邮件

这里是我的php.ini的邮件部分:

 
    [mail function] 
    ; For Win32 only. 
    ; http://php.net/smtp 
    SMTP = localhost 
    ; http://php.net/smtp-port 
    smtp_port = 25 

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

    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 
    ; http://php.net/sendmail-path 
    ;sendmail_path = 

    ; 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 = On 

    ; The path to a log file that will log all mail() calls. Log entries include 
    ; the full path of the script, line number, To address and headers. 
    ;mail.log = 
    ; Log mail to syslog (Event Log on NT, not valid in Windows 95). 
    ;mail.log = syslog 

我的问题是,怎么样,或者哪里的电子邮件被发送自?我从来没有以任何方式配置AMPPS来发送电子邮件。他们似乎工作。

我问的原因是,我试图在本地网络服务器上安装AMPPS,但即使在使用我的gmail帐户配置smpt电子邮件设置后也无法收到电子邮件。

回答

0

我发现OS X预装了postfix,这就是为什么我不需要为PHP设置SMTP设置。

但是,与我的电脑问题,并避免更多的麻烦,我只是在我的Windows本地服务器上安装hMailServer和PHP邮件()函数完美地发送电子邮件。

+0

如果你注册到我的本地主机上的一个站点它说验证邮件,电子邮件显示在vim/var/mail/USER文件中的一个文件中,但无法弄清楚如何让电子邮件从本地主机到Gmail服务器。 – wuno

+0

你在使用什么操作系统? Linux或OS X? –

+0

我正在使用osx。 – wuno