import rfc822 # email headers and such
François Granger
francois.granger at free.fr
Wed Aug 16 15:20:19 EDT 2000
Matthew Dixon Cowles <matt at mondoinfo.com> wrote:
> For accessing the body of a message, rfc822.py leaves its input object
> at the beginning of the body, so you can just read the body from the
> object you originally gave it.
Some code I wrote:
try:
f = open(file, 'r')
except IOError, msg:
print file, ': can\'t open :', msg
return msg
#[...]
m = rfc822.Message(f, 1)
# [...]
m.rewindbody ()
msgContent = f.read()
f.close()
--
"Computers are like horses; they can sense fear and will act based on
that. Or, look at it like this. If you have a premonition of danger,
maybe you're right." - Adam Engst
More information about the Python-list
mailing list