mailx使用smtp邮箱发送邮件

注意阿里云已经封禁25端口,必须先配置ssl登录

https://www.cnblogs.com/liutao97/p/8387244.html

mkdir -p /root/.certs/

echo  -n | openssl s_client -connect smtp.126.com:465 |  sed  - ne  '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'  > ~/.certs /qq .crt
certutil -A -n  "GeoTrust Global CA"  -t  "C,,"  -d ~/.certs -i ~/.certs /qq .crt
certutil -L -d  /root/ .certs<br><br>若需要qq的ssl  只需把第二条命令中的smtp.xxx.com:465  给替换了就行
 
set  [email protected]
set  smtp=smtps: //smtp .126.com:465
set  smtp-auth-password=你的授权码
set  smtp-auth=login
set  ssl-verify=ignore
set  nss-config- dir = /root/ .certs
 
/etc/mail.rc
测试邮件:

echo "HEllo_test_test1" | mailx -v -s "zabbix_test_mail" [email protected]

猜你喜欢

转载自www.cnblogs.com/ying568353087/p/13365061.html
今日推荐