我想从我的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 = [email protected] ; 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"
[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
一个常见的问题是,一个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 = [email protected] auth_username = [email protected] auth_password = password ; For Win32 only. ; http://PHP.net/sendmail-from ;sendmail_from = [email protected]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。