CentOS7 Sendmail test send email
# Install sendmail sendmail-cf m4
yum install sendmail sendmail-cf m4
# edit local host name
vi /etc/mail/local-host-names
xxx.com
# edit sendmail.mc
vi /etc/mail/sendmail.mc
#change 127.0.0.1 to 0.0.0.0
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
# change sendmail setting
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# setting relay
vi /etc/mail/access
Connect:xxx.com RELAY
# hash database
makemap hash access < access
# restart sendmail
systemctl restart sendmail
# test php send mail
php -a
mail('user@receiver.com', "Test email", "Test email from the Internet", null, "-f user@sender.com");
訂閱:
文章 (Atom)