开发者

Get XAMPP PHP mail function to work in OS X

开发者 https://www.devze.com 2023-01-21 04:03 出处:网络
I\'m using XAMPP for Mac, and it seems that the mail function doesn\'t work. I\'ve tried changing from using sendmail to use SMTP (gmail) without luck. Now my php.ini looks like:

I'm using XAMPP for Mac, and it seems that the mail function doesn't work. I've tried changing from using sendmail to use SMTP (gmail) without luck. Now my php.ini looks like:

[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

If I do "tail -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=<20101020170748.6E89FCA7960@mymac.lan>
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=<20101020170748.736D7CA7961@mymac.lan>
Oct 20 18:07:48 mymac postfix/qmgr[17169]: 6E89FCA7960: from=<nobody@mymac.lan>, size=310, nrcpt=1 (queue active)
Oct 20 18:07:48 mymac postfix/qmgr[17169]: 736D7CA7961: from=<nobody@mymac.lan>, 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 postfi开发者_C百科x/smtp[17176]: connect to ASPMX.L.GOOGLE.com[209.85.229.27]:25: Operation timed out

Anyone managed to get the PHP mail() function to work in XAMPP for Mac? I don't care SMTP, sendmail, whatever. Running out of ideas...


Is this your local home machine, or a hosted server somewhere. Some ISPs firewall off the SMTP ports (25 & 465) to anything but their own SMTP server, as an anti-spam measure (can't send penis spam if you can't talk to port 25/465). Try using your ISP's/provider's own SMTP server for a test and see if that goes through.

You could try port 587 (submission), which is somewhat of an alternate method, but no guarantee it works. Google might not be listening for that.

0

精彩评论

暂无评论...
验证码 换一张
取 消