sendmail发件人显示为xxx@localhost.localdomain代发的解决方法

用php内置函数通过sendmail发送信件的话,可以在php.ini中修改:

sendmail_path =/usr/sbin/sendmail -f service@domain.com -t -i

重启web服务,或重启php-fpm

问:但是如果一台服务器有两个或以上域名怎么办?另一个域名不也用设置的那个发送了么?

答:

<?php
ini_set('sendmail_path','/usr/sbin/sendmail -f service@domain.com -t -i');

评论关闭

回到顶部~