title: Reading attributes of .msg file
body: <p>I am trying to read a .msg file to get the sender, recipients, and title.</p>
  
  <p>I'm making this script for my workplace where I'm only allowed to install default python libraries so I want to use the email module to do this.</p>
  
  <p>On the python website I found some examples of using the email module. <a href="https://docs.python.org/3/library/email.examples.html" rel="nofollow noreferrer">https://docs.python.org/3/library/email.examples.html</a></p>
  
  <p>Near the end of the page it talks about getting the sender, subject and recipient. I've tried using this code like this:</p>
  
  <pre><code># Import the email modules we'll need
  from email import policy
  from email.parser import BytesParser
  
  with open('test_email.msg', 'rb') as fp:
      msg = BytesParser(policy=policy.default).parse(fp)
  
  # Now the header items can be accessed as a dictionary, and any non-ASCII will
  # be converted to unicode:
  print('To:', msg['to'])
  print('From:', msg['from'])
  print('Subject:', msg['subject'])
  </code></pre>
  
  <p>This results in an output:</p>
  
  <pre><code>To: None
  From: None
  Subject: None
  </code></pre>
  
  <p>I checked the file test_email.msg, it is a valid email. </p>
  
  <p>When I add a line of code</p>
  
  <pre><code>print(msg) 
  </code></pre>
  
  <p>I get an output of a garbled email the same as if I opened the .msg file in notepad.</p>
  
  <p>Can anybody suggest why the email module isn't finding the sender/recipient/subject correctly?</p>