The python--on the station is a bad sub-message.

Source: Internet
Author: User

Today want to write a message parsing file, read a piece of code, the source code is roughly as follows:

import sys, emailmailfile = open ('./ ReceivedHeader.txt ', ' R ') #mail载入并存入内存并解析它 #msg = email.message_from_file (Sys.stdin) msg =  Email.message_from_file (mailfile) #print "Msg.items ()  function:\n" #print  msg.items () #print   "///// "print " *** headers in message: "#循环输出键和值for  header, value in  msg.items ():    print header+  ":"     print  "   "+ valueif msg.is_multipart ():    print " this program  Cannot handle mime multipart messages; exiting. "     sys.exit (1) print  "-" *78if  ' subject '  in msg:     print  "Subject:"  , msg[' Subject ']    print  "-" *78print  " Message body: "Printprint msg.get_payload () 

is still a very simple and practical example, but is_multipart this function is not clear, to the official web-based review, given the following explanations:

Is_multipart () return True if the message ' s payload is a list of Sub-message objects, otherwise return False. When Is_multipart () returns FALSE, the payload should is a string object.

I xx ...., God Horse is a sub-mail ah, have not heard, and then after the search to understand that the so-called "sub-mail" is "spam", said the good euphemism, it is fluent, Is_multipart () is used to determine whether it is spam, if it is junk e-mail returns True, Otherwise, false is returned.

The matter is done, search the sub-mail, found a tall man's answer, reproduced under, happy, haha.

What is a sub-mail? Scam e-mail: It means unlucky her family are dead, he is also old, and have cancer, but her husband left him a legacy, and unlucky she on the internet magically got your e-mail address, she thought you must be God's good child, so want to give you the estate to deal with. That's basically what it means. At the peak of my time, I received one day. The Old high.


This article is from the "26-year-old" blog, please be sure to keep this source http://dbbruce.blog.51cto.com/2061658/1573857

The python--on the station is a bad sub-message.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.