[英]Use php mail() function with custom exim installation
I have an exim installation in a non-standard path. 我在非标准路径中安装了exim。
How can I configure php so that mail() will use it? 如何配置php,以便mail()使用它?
The solution is to change the value of the "sendmail_path" variable in php.ini: 解决方案是更改php.ini中“ sendmail_path”变量的值:
sendmail_path="/my_custom_path/exim -t -i"
exim is compatible to sendmail when it comes to command line arguments 在命令行参数方面,exim与sendmail兼容
After guarantee that exim4 is really running without any problem. 保证exim4确实在运行时没有任何问题。
sudo service exim4 statusor
sudo /etc/init.d/exim4 statusNote .: Pay attention to result at the command line.sudo /etc/init.d/exim4状态
\n * Stopping MTA for restart*停止重新启动MTA\n * Restarting MTA
*重新启动MTA\nALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken
警报:exim paniclog / var / log / exim4 / paniclog具有非零大小,邮件系统可能损坏\n
You may edit the file 您可以编辑文件
/etc/php5/apache2/php.iniand add the line/etc/php5/apache2/php.ini
sendmail_path = "/my_custom_path/exim -t"without the option -i which will cause problems.sendmail_path =“ / my_custom_path / exim -t”
So, type that to test, 因此,请输入进行测试,
echo "Testing."instead of test with PHP function.回显“测试”。 |
| mail -s Test example@gmail.com
邮件-s测试example@gmail.com
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.