"" wrote:
> i have use a temp method to overcome it .
>
> i still think the email lib should give the boundary border to parse
> mail.
the email lib you're using is a PARSER, and it's already PARSING the
mail for you.
(if you have trouble structuring your program when someone else is doing
t
thanks.
i have use a temp method to overcome it .
i still think the email lib should give the boundary border to parse
mail.
code is as following:
def parse_mail_content(self, mail):
content =''
alter =False
subty =''
html =''
plain =
myself wrote a multipart parser in java(i customise it because i need
get information of "upload progress"). and i think it's also easy to
implement in python, i've not have time done it, or i'll post it.
but if you're no other special needs, just use email lib, it's quick to
program and if you rea
On 30/08/2006 4:44 PM, 叮叮当当 wrote:
> yes, the special is i must choose exactly one section to destruct,
> instead of processing all subparts.
So have you tried to use the example I posted yesterday? Do you still
have any problems? Note: it is generally a good idea to post a message
when you have
yes, the special is i must choose exactly one section to destruct,
instead of processing all subparts.
John Machin 写道:
> Tim Roberts wrote:
> > "" <[EMAIL PROTECTED]> wrote:
> >
> > >i know how to use email module lib.
> > >
> > >the question is about how to handle the rfc 1521 mime
> > >mul
Tim Roberts wrote:
> "" <[EMAIL PROTECTED]> wrote:
>
> >i know how to use email module lib.
> >
> >the question is about how to handle the rfc 1521 mime
> >mulitpart/alternitave part .
> >
> >i know emai can handle mulitpart , but the subpart alternative is
> >special .
>
> No, it's not. A m
"" <[EMAIL PROTECTED]> wrote:
>i know how to use email module lib.
>
>the question is about how to handle the rfc 1521 mime
>mulitpart/alternitave part .
>
>i know emai can handle mulitpart , but the subpart alternative is
>special .
No, it's not. A multipart/alternative section is construc
叮叮当当 wrote:
> this is not enough.
>
> when a part is mulitpart/alternative, i must find out which sub part i
> need, not all the subparts. so i must know when the alternative is
> ended.
>
So you'll have to write your own tree-walker. It would seem that
is_multipart(), get_content_type() and get_p
"" wrote:
> btw, i know how to use walk(), and the question is not this.
so what is the question?
--
http://mail.python.org/mailman/listinfo/python-list
i know how to use email module lib.
the question is about how to handle the rfc 1521 mime
mulitpart/alternitave part .
i know emai can handle mulitpart , but the subpart alternative is
special .
Steve Holden 写道:
> 叮叮当当 wrote:
> > supose a email part like this:
> >
> > Content-Type: Multipart
this is just a temp solution for the simplest email format as my
example, and i cannot always only show the html part.
but in fact , there are many more difficult mail format
btw, i know how to use walk(), and the question is not this.
my code is as the following:
def mail_content(mail):
co
叮叮当当 wrote:
> supose a email part like this:
>
> Content-Type: Multipart/Alternative;
> boundary="Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm"
>
>
> --Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm
> Content-Type: text/plain; charset="gb2312"
> Content-Transfer-Encoding: 7bit
>
>abcd.
> --Boundary-=_i
"" wrote:
> the plain text is abcd, and the alternative content type is text/html,
> i should prefer explain the html content, and i must not explaint the
> two part ,so i want to get the boundary end.
so use the email module:
import email
message_text = "..."
message = email.m
i just use email module lib.
Max M 写道:
> 叮叮当当 wrote:
> > this is not enough.
> >
> > when a part is mulitpart/alternative, i must find out which sub part i
> > need, not all the subparts. so i must know when the alternative is
> > ended.
>
>
> Have you tried the email module at all?
>
>
> --
>
>
supose a email part like this:
Content-Type: Multipart/Alternative;
boundary="Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm"
--Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 7bit
abcd.
--Boundary-=_iTIraXJMjfQvFKkvZlqprUgHZWDm
Content-
叮叮当当 wrote:
> this is not enough.
>
> when a part is mulitpart/alternative, i must find out which sub part i
> need, not all the subparts. so i must know when the alternative is
> ended.
Have you tried the email module at all?
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Sci
this is not enough.
when a part is mulitpart/alternative, i must find out which sub part i
need, not all the subparts. so i must know when the alternative is
ended.
John Machin 写道:
> 叮叮当当 wrote:
> > hi, all
> >
> > when a email body consist with multipart/alternative, i must know when
> > the
叮叮当当 wrote:
> hi, all
>
> when a email body consist with multipart/alternative, i must know when
> the boundary ends to parse it,
>
> but the email lib have not provide some function to indicate the
> boundary end, how to solve it ?
By reading the manual.
http://docs.python.org/lib/module-email.M
"" wrote:
> when a email body consist with multipart/alternative, i must know when
> the boundary ends to parse it,
or use a library that understands multipart messages.
> but the email lib have not provide some function to indicate the
> boundary end, how to solve it ?
http://docs.pyt
hi, all
when a email body consist with multipart/alternative, i must know when
the boundary ends to parse it,
but the email lib have not provide some function to indicate the
boundary end, how to solve it ?
thanks.
--
http://mail.python.org/mailman/listinfo/python-list
20 matches
Mail list logo