2010-10-20 101 views
2

我正在使用XAMPP for Mac,并且似乎邮件功能不起作用。我试过用sendmail改用SMTP(gmail)而没有运气。现在,我的php.ini的样子:获取XAMPP PHP邮件功能在OS X中工作

[mail function] 
SMTP = smtp.gmail.com 
smtp_port = 465 
smtp_ssl=auto 
auth_username=[user]@gmail.com 
auth_password=[pass] 
sendmail_from=[user]@gmail.com 

如果我做 “尾-f /var/log/mail.log”:

Oct 20 18:07:48 mymac postfix/master[17166]: daemon started -- version 2.5.5, configuration /etc/postfix 
Oct 20 18:07:48 mymac postfix/pickup[17168]: 6E89FCA7960: uid=-2 from=<nobody> 
Oct 20 18:07:48 mymac postfix/cleanup[17170]: 6E89FCA7960: message-id=<[email protected]> 
Oct 20 18:07:48 mymac postfix/pickup[17168]: 736D7CA7961: uid=-2 from=<nobody> 
Oct 20 18:07:48 mymac postfix/cleanup[17170]: 736D7CA7961: message-id=<[email protected]> 
Oct 20 18:07:48 mymac postfix/qmgr[17169]: 6E89FCA7960: from=<[email protected]>, size=310, nrcpt=1 (queue active) 
Oct 20 18:07:48 mymac postfix/qmgr[17169]: 736D7CA7961: from=<[email protected]>, size=417, nrcpt=1 (queue active) 
Oct 20 18:08:19 mymac postfix/smtp[17174]: connect to ASPMX.L.GOOGLE.com[209.85.227.27]:25: Operation timed out 
Oct 20 18:08:19 mymac postfix/smtp[17176]: connect to ASPMX.L.GOOGLE.com[209.85.229.27]:25: Operation timed out 

任何人都设法让PHP的mail()函数在XAMPP for Mac中工作?我不在乎SMTP,sendmail,不管。用尽想法...

回答

0

这是您的本地家庭计算机,还是某处的托管服务器。一些ISP防火墙将SMTP端口(25 & 465)作为反垃圾邮件措施(如果您无法与端口25/465通信,则不能发送阴茎垃圾邮件)关闭到其自己的SMTP服务器。尝试使用您的ISP /提供商自己的SMTP服务器进行测试,看看是否会通过。

可能尝试端口587(提交),这是一种替代方法,但不保证它的工作原理。谷歌可能不会听这个。