|
Posted by Steve on 09/19/07 06:11
"Harold Philips" <haroldphilips@adcl.biz> wrote in message
news:46f08b22$0$21137$88260bb3@free.teranews.com...
>>>>> Hello Everyone,
>>>>>
>>>>> Does anyone know of an easy way to access the body of an email in PHP?
>>>>> I have a box with a bunch of one line email in it. All I need to
>>>>> retreive is the senders email address and the body. Can anyone help?
>>>>>
>>>>> Thanks,
>>>>> Harold
>
>>>> if you look at the rfc for email, you'll find out what the tags are.
>>>> parse those for their respective values. the body is, by rfc, is
>>>> seperated from the header by two new line characters...and is the last
>>>> portion of the email. if you don't like reading the rfc, save an email
>>>> as a text file. open the text file in a text editor. look for the tags
>>>> you expect to parse...then create the code to do your parsing.
>>>>
>>>> that is the 'easy' way...but far from an 'easy button'. ;^)
>>>
>>> Thank you for the reply. Definately not the "easy" button but a lot
>>> closer to it than I was.
>>
>> are you comfortable with parsing?
>
> No, I'm not. I am almost terrified of regular expressions. lol
> It sucks to because all I need is to get the body of the email and the
> sender.
> Why do you as?
because i can help. you don't need regex to do it. if you just want the
body, find the first occurance of \r\n\r\n. where that occurs, use substr
and you have it...that doesn't take into account that the message itself may
be part of a multi-mimed format - one that gives both a text version and the
other, html.
does that get you going?
Navigation:
[Reply to this message]
|