I want to make changes to the content of .msg file and save it back as .msg file(In the body of the message , I want to replace 'example.com' with 'replcement_text.com'). Not able to proceed further.
import extract_msg
folder = r"C:\Users\My_desk\Downloads\New folder"
with os.scandir(folder)as files:
files = os.scandir(folder)
for file in files:
msg = extract_msg.Message(file)
msg_sender = msg.sender
msg_date = msg.date
msg_subj = msg.subject
msg_message = msg.body