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