我正在从使用邮件的服务器迁移到使用sendmail的服务器.我很难找到如何通过命令行将主题正确发送到sendmail.
/usr/local/bin/PHP -f /path/to/file.PHP 2>&1 | /usr/sbin/sendmail -s "My Test Email Subject" test@email.com
/usr/sbin/sendmail
那是错的.
你应该在哪里有一个邮件命令.它可以被称为mailx.应该在/ bin /目录中.作为标准做法,PHP脚本永远不应该在/ sbin或/usr/sbin中调用任何东西. sbin程序通常用于root.
另外,PHP内置了mail function.