In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain the example analysis of python email protocol for you in detail. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
1. SMTP protocol, which is a simple mail transfer protocol.
Is a set of rules for transferring mail from the source address to the destination address, which controls the way the message is transferred (transit protocol)
2. POP3 protocol, that is, the third edition of the post office agreement.
Allows users to store messages from the server on the local host while deleting messages saved on the mail server (read protocol)
3. IMAP protocol, message access protocol (read protocol).
4. Multi-channel Internet mail extension protocol.
Solved the restriction that SMTP protocol can only transmit ASCII text, and used the binary data of sound and image table as email [the external link image transfer failed, and the origin server may have hotlink protection mechanism. It is recommended to save the image and upload it directly (img-Lm7dARYe-1630476391787) (C:\ Users\ dell\ desktop\ QQ screenshot 20210815142825.png).
Example
#-*-coding: cp936-*-from email.mime.multipart import MIMEMultipartfrom email.mime.text import MIMETextimport smtplibimport sysimport osimport datetimeimport timeimport subprocess reload (sys) sys.setdefaultencoding ("utf-8") mailto_list = ["lusongcool@163.com"] # Target mailbox mail_host = "smtp.163.com" mail_user = "lusongcool@163.com" mail_pass = "*" # 163password generated by smtp (to_list, sub) Content): me = "LogServer" + "" msg = MIMEText (content, _ subtype='plain', _ charset='utf-8') msg ['Subject'] = sub msg [' From'] = me msg ['To'] = " ".join (to_list) try: server = smtplib.SMTP () server.connect (mail_host) server.login (mail_user, mail_pass) server.sendmail (me, to_list, msg.as_string () server.close () return True except Exception E: print str (e) return False if _ _ name__ ='_ _ main__': send_mail (mailto_list, 'submit',' content') on "sample analysis of python mail protocols" is here. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.