Exim4 是 Debian 默认的 MTA (Message Transfer Agent) ,连基本系统里面都有它,用他自然是和系统兼容性最好的了。
1.安装exim4
apt-get install exim4
2.进行配置,第一项选择第一个“internet site; mail is sent and received directly using SMTP”,然后一路默认Next。
dpkg-reconfigure exim4-config
3.修改配置文件
vi /etc/exim4/update-exim4.conf.conf
内容如下:
dc_eximconfig_configtype='internet'
dc_other_hostnames='xxx.com'
dc_local_interfaces='127.0.0.1'
dc_readhost='xxx.com'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
dc_other_hostnames 改为自己的vps主机名,dc_readhost 改为你的邮箱后缀
4.重启 exim4
/etc/init.d/exim4 restart
5.php使用exim4发信,修改php.ini,然后重启php
sendmail_path = /usr/sbin/sendmail -t -i