Help with body parsing from an email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • [ Nicola ]

    Help with body parsing from an email

    Using imap i must zap through emails in my email address, then saving
    part of the message (the main body that is).
    Question is, how am i supposed to read only the message's content,
    ignoring all additional informations (charset and whatsoever?
    I'm currently reading the text like this:
    imap_body ($this->inbox, $i)
    Fact if, that this way i get all other information

    ex:
    ------------------------------- CONTENUTO DEL
    BODY------------------------------------

    ------_=_NextPart_001 _01C67B66.A8D17 11B
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    charset=3Diso-8859-1">
    6.5.7650.21">

    P Programmazione per il web 430123

    __________ Informazione NOD32 1.1548 (20060519) __________

    Questo messaggio =E8 stato controllato dal Sistema Antivirus NOD32
    ESET® protegge piu' di 110 milioni di utenti nel mondo con le migliori soluzioni di sicurezza informatica presenti sul mercato. Provale gratuitamente per 30 giorni !


    ------------------------------------- FINE CONTENUTO DEL
    BODY-----------------------------
    Now, what i'm interested is just the "P Programmazione per il web
    430123" string, any lead about how to get that and only that out of the
    message?
    is there any imap method that can do it for me?

    Thanks in advance.

  • tim

    #2
    Re: Help with body parsing from an email


    [ Nicola ] wrote:[color=blue]
    > Using imap i must zap through emails in my email address, then saving
    > part of the message (the main body that is).
    > Question is, how am i supposed to read only the message's content,
    > ignoring all additional informations (charset and whatsoever?
    > I'm currently reading the text like this:
    > imap_body ($this->inbox, $i)
    > Fact if, that this way i get all other information
    >
    > ex:
    > ------------------------------- CONTENUTO DEL
    > BODY------------------------------------
    >
    > ------_=_NextPart_001 _01C67B66.A8D17 11B
    > Content-Type: text/html;
    > charset="iso-8859-1"
    > Content-Transfer-Encoding: quoted-printable
    >
    > charset=3Diso-8859-1">
    > 6.5.7650.21">
    >
    > P Programmazione per il web 430123
    >
    > __________ Informazione NOD32 1.1548 (20060519) __________
    >
    > Questo messaggio =E8 stato controllato dal Sistema Antivirus NOD32
    > http://www.nod32.it
    >
    > ------------------------------------- FINE CONTENUTO DEL
    > BODY-----------------------------
    > Now, what i'm interested is just the "P Programmazione per il web
    > 430123" string, any lead about how to get that and only that out of the
    > message?
    > is there any imap method that can do it for me?
    >
    > Thanks in advance.[/color]

    I think imap_fetchbody will get what you want

    Read the follow up comment by 'sales at nocwizard dot com' on


    Tim

    Comment

    Working...