I am trying to modify emails stored as text files. I first import the message as follows:
import email
f = open('filename')
msg = email.message_from_file(f)
Then I make all the changes I want using the functions of the email module.
The last step is to save the message object (msg) in a file. What part of the code does this? It seems that there is no simple function like message_to_file () "...
Many thanks.
source
share