在linux中使用mailx发送邮件

 
更多

 

[root@ml ~]# yum -y install mailx   #安装

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

在最后一行添加(我这里使用的是qq邮箱):

set from=664268***@qq.com  #来自  
set smtp=smtp.qq.com #qq的smtp邮箱
set smtp-auth-user=664268***@qq.com #账号
set smtp-auth-password=wzkwaotbwples***  #授权码(下图教怎么在q邮箱获取)
set smtp-auth=login #认证方式,可以是ssl,默认是login

 

 选择账户,然后往下滑。

 

 测试:

  [root@ml ~]# echo “你好” | mailx -s “meml” memlkk@163.com 

 使用465

 

mkdir -p /root/.certs/
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -L -d /root/.certs

 

打赏

本文固定链接: https://www.cxy163.net/archives/5273 | 绝缘体-小明哥的技术博客

该日志由 绝缘体.. 于 2020年04月18日 发表在 Linux, rust, 操作系统, 编程语言 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 在linux中使用mailx发送邮件 | 绝缘体-小明哥的技术博客
关键字: , , , ,

在linux中使用mailx发送邮件:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter