配置邮件发送任务

[root@BC ~]# yum install  -y  mailx

[root@BC ~]# vim /etc/mail.rc

#发件人

set from=xxx@qq.com
#邮件服务器

set smtp=smtp.qq.com
#发件人用户名

set smtp-auth-user=xxx@qq.com
#发件人密码(QQ邮箱不可以使用密码,只能使用授权码)

set smtp-auth-password=xxx
#登录方式

set smtp-auth=login
#邮件服务器协议及端口

set smtp=smtps://smtp.qq.com:465
#忽略证书

set ssl-verify=ignore
#指定证书位置

set nss-config-dir=/etc/pki/nssdb/

#或者指定别的证书位置,创建证书目录



#放到最后  
set from=xxx@qq.com
set smtp=smtp.qq.com
set smtp-auth-user=xxx@qq.com
set smtp-auth-password=xxx		#客户端的授权码  
set smtp-auth=login
set smtp=smtps://smtp.qq.com:465
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/


[root@BC ~]# echo  "test"  | mail  -s "hello"  xxxx@qq.com
[root@BC ~]# Error in certificate: Peer's certificate issuer has been marked as not trusted by the.		#忽略这个错误 
posted @ 2021-02-07 11:52  水煮沉浮~大刀肉  阅读(84)  评论(0)    收藏  举报