加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP Mail()在Mac OS X Leopard上使用Sendmail(10.5.8)

发布时间:2020-12-13 13:46:54 所属栏目:PHP教程 来源:网络整理
导读:我一直在努力获得一个真正基本的 PHP函数,我的iMac,PHP mail()函数. 我已经使用了无数次,尽管在Windows平台上,现在我试图让它在Mac上运行. 我已经安装了XAMPP v1.01,可能是因为我当时不了解任何更好的东西,我以为这一切都可以正常工作,因为这是应该做的. (或
我一直在努力获得一个真正基本的 PHP函数,我的iMac,PHP mail()函数.

我已经使用了无数次,尽管在Windows平台上,现在我试图让它在Mac上运行.

我已经安装了XAMPP v1.01,可能是因为我当时不了解任何更好的东西,我以为这一切都可以正常工作,因为这是应该做的. (或者所以我想).

我尝试了以下各页的说明无效:

> http://blog.rajatpandit.com/2009/03/15/php-mail-and-osx-leopard/
> http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update
> http://forums.oreilly.com/index.php?showtopic=5243&mode=threaded&pid=14721
> http://jspr.tndy.me/2008/05/php-mail-and-osx-leopard/

首先我没有一个条目:
MAILSERVER = -YES-在我的/ etc / hostconfig中,所以我创建了它.

我在php.ini中添加了sendmail的完整路径:sendmail_path =“/usr/sbin / sendmail -t -i”

我明白我不需要在/etc/postfix/main.cf中设置一个myhostname变量,因为我只是计划发送邮件没有收到它. (请注意,我也尝试使用此设置启用!)

我已经开始后缀,然后尝试运行脚本,但是脚本只是处理没有错误消息,它基本上看起来好像它的工作,但没有发生(我已经三重检查脚本的代码).

我注意到一些人的解决方案甚至没有提到必须启动postfix守护进程才能让PHP mail()函数工作.

任何想法或事情给我试试吗?

如果您需要更多信息,请问.

P.

从这里贴一个答案: http://macosx.com/forums/unix-x11/19819-sendmail-not-working.html

听起来像您发布的日志条目的问题.

此外,该帖子的作者建议您在系统更新后再次执行此操作,因此“修复权限”不是您想要的….并且可能是您想要的OPPOSITE.

The most common problem with sendmail on OS X is just a permission problem,and one which will show up after installing most packages from Software Update. Check /var/log/mail.log and see if it’s complaining a lot about a group writable directory. If that’s the case,then the problem is that the root directory is group writable. That’s easily fixed with a quick “sudo chmod g-x /”. Then sendmail should be able to start properly,and I think it can be invoked by typing “/usr/sbin/sendmail -bd -q1h”. Again,if all else fails,reboot.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读