0. There is a very fast way
Command: hostname itzhanzhang.com, but the restart will not work, so please continue to look down once and for all methods:
1. Set your host name
The default hostname is similar to "Vm_24_76_centos" and the email address is "sent by <[email protected]_24_76_centos>"
And we do not like this address, you can modify the/etc/sysconfig/network file, modify the host name, such as my domain name is itzhanzhang.com, I can be modified as: hostname=itzhanzhang.com
2. Modify the SendMail domain name
Edit the/etc/mail/local-host-names file, add a domain name, such as my Itzhanzhang, can be modified as:
3. Modify the DNS server address
If there is no letter, there may be a problem with the DNS server, you can modify the/etc/resolv.conf file, I do not have a problem, it is not modified, such as:
4. Restart the Network Service
Command: Service Network restart
5. Test letters
This time the sender of [email protected] is displayed. I use the root user, it shows "[email protected]"
6. You can also modify the sender by modifying the php.ini file
Code: Sendmail_path =/usr/sbin/sendmail-f [email protected]-t-i
CentOS Setup SendMail sender, let sendmail not show through XXX generation