Get email message mymailbox.msg file : Email : Network PYTHON examples


PYTHON examples » Network » Email »

 

Get email message mymailbox.msg file


 

import rfc822
mailbox_filename = "mymailbox.msg"

file_handle = open("mailbox_filename")
messagedic = rfc822.Message(file_handle)

content_type = messagedic["content-type"]
from_field = messagedic["From"]
to_field = messagedic.getaddr("To")
subject_field = messagedic["Subject"]

file_handle.close()
print content_type, from_field, to_field, subject_field 

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Network
» Email