linux 通过shell 发送QQ邮件技术要点

编程入门 行业动态 更新时间:2024-10-10 11:22:40

linux 通过shell 发送QQ邮件技术<a href=https://www.elefans.com/category/jswz/34/1769303.html style=要点"/>

linux 通过shell 发送QQ邮件技术要点

需求

每周一需要进行上周网站访问情况统计, 然后用python脚本处理数据, 然后发送邮件到统计情况到指定邮箱
考虑到这种工作的重复性以及工作的定时性, 准备让linux自动化帮我做这些工作,果然只有想偷懒才会推动社会进步, 推动科技发达

1. 机器环境
#腾讯云
OS: centos8
2.配置/etc/mail.rc文件 新增如下参数
set from=xxxxxxx@qq
set smtp=smtp.qq
set smtp-auth-user=xxxxxx@qq
#注意这里是授权码 而不是qq登录密码 自己去邮箱里面获取
set smtp-auth-password=xxxxxxx
set smtp-auth=login
set smtp-use-starttls
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
3.然后测试发送邮件
 echo hello word | mail -v -s " title" xxxxxxx @qq

如果输出一些文字,最后几行类似于

Resolving host smtp.qq . . . done.
Connecting to 183.3.225.42:smtp . . . connected.
220 xxxxxxxxx.qq XMail Esmtp QQ Mail Server.
>>> EHLO VM-8-12-centos
250-xxxxxxxx.qq
250-PIPELINING
250-SIZE 73400320
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
>>> STARTTLS
220 Ready to start TLS from 119.29.200.80 to newxmesmtplogicsvrszc5.qq.
Error in certificate: Peer's certificate issuer has been marked as not trusted by the.
Comparing DNS name: "*.mail.qq"
Comparing DNS name: "993.dav.qq"
Comparing DNS name: "993.eas.qq"
Comparing DNS name: "993.imap.qq"
Comparing DNS name: "993.pop.qq"
Comparing DNS name: "993.smtp.qq"
Comparing DNS name: "imap.qq"
Comparing DNS name: "mx1.qq"
Comparing DNS name: "mx2.qq"
Comparing DNS name: "mx3.qq"
Comparing DNS name: "pop.qq"
Comparing DNS name: "smtp.qq"
SSL parameters: cipher=AES-128-GCM, keysize=128, secretkeysize=128,
issuer=CN=GlobalSign Organization Validation CA - SHA256 - G2,O=GlobalSign nv-sa,C=BE
subject=CN=*.mail.qq,O=Shenzhen Tencent Computer Systems Company Limited,L=shenzhen,ST=guangdong,C=CN
>>> EHLO VM-8-12-centos
250-newxmesmtplogicsvrszc5.qq
250-PIPELINING
250-SIZE 73400320
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN
250-MAILCOMPRESS
250 8BITMIME
>>> AUTH LOGIN
334 xxxxxxxxxxxxxx
>>> xxxxxxxxxxxxxxx==
334 xxxxxxxxxxxxx
>>> xxxxxxxxxxxxxxx==
235 Authentication successful
>>> MAIL FROM:<xxxxxxxx@qq>
250 OK.
>>> RCPT TO:<xxxxxxxx@qq>
250 OK
>>> DATA
354 End data with <CR><LF>.<CR><LF>.
>>> .
250 OK: queued as.
>>> QUIT
221 Bye.

那么恭喜你,你就成功了。 你可以去邮箱里面检查是否收到邮件了。

更多推荐

linux 通过shell 发送QQ邮件技术要点

本文发布于:2024-02-26 03:12:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1701178.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:要点   邮件   技术   linux   shell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!