从本地apache服务器发送邮件

我想从我的PHP Web应用程序发送电子邮件。 我知道这是可能的,因为几个月前,我有这个“function”在我的系统,然后我开始使用xpppp和function消失。

我认为,当我回到我的本地服务器,并将使用本地MySQL数据库和以前的东西,我可以再次从我的Web应用程序发送电子邮件。

我将我的操作系统从Mountain Lion更新到了Mavericks(不知道这是否是主要问题),然后又回到本地的apache服务器上去除了xampp。 但我仍然不能从我的networking应用程序发送电子邮件。

我改变了正在使用的php.ini文件,所以我可以使用邮件function:

[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 = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path sendmail_path = "/usr/sbin/sendmail -t -i" 

在特立独行的矿默认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 = me@example.com ; 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 

一个常见的问题是,一个ISP已经阻止了端口25,因为发展我已经修改了php.ini部分邮件如下,我的邮件服务器的smtp端口改为587端口,并更改主机名。

 [mail function] ; For Win32 only. ; http://php.net/smtp SMTP = smtp.example.net ; http://php.net/smtp-port smtp_port = 587 sendmail_from = user@example.net auth_username = user@example.net auth_password = password ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = me@example.com