get_body ( preferencelist = ( 'html' )) for part in richest. content_type = 'multipart/related' : body = richest. parsestr ( 'From: Foo Bar \n ' 'To: \n ' 'Subject: Test message \n ' ' \n ' 'Body would go here \n ' ) # Now the header items can be accessed as a dictionary: print ( 'To: ". import datetime print(' Welcome to age calculator ') birthyear int (input('Enter your year of birth: n')) birthmonth int (input('Enter your month of birth: n')) birthday int. # Import the email modules we'll need from email.parser import BytesParser, Parser from email.policy import default # If the e-mail headers are in a file, uncomment these two lines: # with open(messagefile, 'rb') as fp: # headers = BytesParser(policy=default).parse(fp) # Or for parsing headers in a string (this is an uncommon operation), use: headers = Parser ( policy = default ).
0 Comments
Leave a Reply. |