Centos configure mail server
Use mail to send mail under Centos7
Modify the configuration file and configure the mail-related content (appended to the end of the configuration file)
[root@ProxyServer ~] # vi / etc/mail.rc
Set from=373416873@qq.com
Set smtp=smtp.qq.com
Set smtp-auth-user=373416873@qq.com
Set smtp-auth-password=password
Set smtp-auth=login
Set smtp-port=587
test
Echo "Hello, world" | mail-s "ceshi" 373416873@qq.com
If it is not successful, do the following
First, check whether the relevant service is installed.
[root@ProxyServer ~] # rpm-qa | grep mail
Libreport-plugin-mailx-2.0.9-19.el6.x86_64
Mailx-12.4-7.el6.x86_64
Procmail-3.22-25.1.el6.x86_64
Mailcap-2.1.31-2.el6.noarch
Sendmail-8.14.4-8.el6.x86_64
If the service is not secured, execute the following command to install the service
[root@ProxyServer ~] # yum install sendmail
[root@ProxyServer ~] # yum install mailx-y
[root@ProxyServer ~] # yum update libreport-plugin-mailx
[root@ProxyServer ~] # yum-y install sharutils
[root@ProxyServer ~] # yum install mutt