centos配置/etc/mail.rc发邮件

安装mailx:

yum install mailx

vi /etc/mail.rc

set from=524755798@qq.com
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user=524755798
set smtp-auth-password=xxxxxxx (邮箱账号的客户端授权码,需要登陆自己的邮箱进行设置,不是邮箱密码)
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb

测试:

echo test | mailx -v -s "test"  test@126.com

原文地址:https://www.cnblogs.com/dongruiha/p/8807111.html