php使用mail邮件服务器,PHP mail()中继到邮件服务器

does the PHP mail() function automatically create an SMTP message to

the server? Or do I have to set the php.ini settings to look at the

localhost and then configure sendmail/postfix to send the message to

the mail server

PHP的mail()函数本身并不能做很多事情.在linux上,通常使用php.ini中定义的设置连接到sendmail或类似的本地实例.从示例php.ini中查看以下部分:

[mail function]

; For Win32 only.

; SMTP = localhost

; smtp_port = 25

; For Win32 only.

;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").

sendmail_path = /usr/sbin/sendmail -t -i

对于Windows,mail()使用配置端口上的SMTP服务器.对于linux,使用定义的sendmail路径.

换句话说,Windows上的PHP mail()函数连接到本地或远程的SMTP服务器. Linux上的PHP mail()无法做到这一点.在Linux上,该功能将仅使用本地sendmail安装,您需要先进行本地设置以连接到SMTP服务器.这种配置的替代方法是使用PHPMailer,Swiftmailer,Zend_Mail或类似的工具,它们自己提供SMTP功能.

why would it bother to authenticate with the domain controller if I

only specified that the LAMP server try to connect with the mail

server?

我还不是专家,但是据我了解,您需要在网络中经过身份验证的用户才能访问邮件所需的外部资源.域控制器发出这种权限.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值