1、安装mailx
yum install mailx -y
2、编辑配置文件
vim /etc/mail.rc
set from=yourmailname@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=yourmailname@qq.com
set smtp-auth-password=QQ授权码
set smtp-auth=login
3、测试邮件
echo test |mailx -v -s "test" yourmailname@qq.com
Linux系统--CentOS 7.6.1810 配置QQ邮箱
原文:https://www.cnblogs.com/shuter/p/11238980.html