安装配置mailx
QQ邮箱设置授权码
![img](https://i-blog.csdnimg.cn/blog_migrate/de923171fada81328801ab7b731ba7d0.png)
安装
yum install mailx # centos
sudo apt-get install heirloom-mailx # ubuntu
编辑配置文件
vim /etc/mail.rc
添加如下内容
set from=**4306@qq.com
set smtp=smtps://smtp.qq.com:465
set smtp-auth-user=xx4306@qq.com
set smtp-auth-password=************