Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33136

Re: Question about email.message_from_string() and Message objects

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From tinnews@isbd.co.uk
Newsgroups comp.lang.python
Subject Re: Question about email.message_from_string() and Message objects
Date Sun, 11 Nov 2012 17:38:24 +0000
Lines 25
Message-ID <gd45n9-lli.ln1@chris.zbmc.eu> (permalink)
References <9vr4n9-t2h.ln1@chris.zbmc.eu>
X-Trace individual.net /9V1tpqdQ39ddnGSpB1ByQG6GzbYCD6jl6EFtMQ/5uNkHsbuYqUrLAHJ0nbZzJIlg=
X-Orig-Path not-for-mail
Cancel-Lock sha1:wHsbDD+rqGKzUjLsvlZgvWAmmtw=
User-Agent tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (Linux/3.2.0-32-generic (x86_64))
Xref csiph.com comp.lang.python:33136

Show key headers only | View raw


tinnews@isbd.co.uk wrote:
> I'm a little confused about the relationship between the Python
> email.parser convenience function email.message_from_string() and the
> mailbox.Message objects.
> 
> If I want an mailbox.mboxMessage given the message as a stream of text
> is the right way to do it as follows (or at least a reasonable way to
> do it):-
> 
>     msg = email.message_from_string(messageAsAString)
> 
>     mbxMsg = mailbox.mboxMessage(msg)
> 
> Or can I go direct to mbox by doing:-
> 
>     mbxMsg = mailbox.mboxMessage(messageAsAString)
> 
Answered myself by just trying it, the simple, straightforward 

    mbxMsg = mailbox.mboxMessage(messageAsAString)

works perfectly.

-- 
Chris Green

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Question about email.message_from_string() and Message objects tinnews@isbd.co.uk - 2012-11-11 15:14 +0000
  Re: Question about email.message_from_string() and Message objects tinnews@isbd.co.uk - 2012-11-11 17:38 +0000

csiph-web