Hi there,

I'm downloading xml files from a mail server using POP3Client. I'm saving these mails 
as files on a directory. I also parse out certain details from the XML file to include 
in the filename.

The only problem is that, when I grab the body of the message using POP3Client's 
method, it includes mail-related information above and below the actual XML tags. 

------=_Part_15_1895070.1044374870502
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

<?xml version="1.0"?>
...

</Order>
------=_Part_15_1895070.1044374870502--


So, I need to remove everything before the opening <?xml string and, again, everything 
after the closing </Order> tag. I thought about stripping out the first 4 and last 4 
lines of the file but the messages sometimes arrive clean, and sometimes with this 
extra info.

I've trawled newsgroups and the web and haven't been able to come up with any answers. 

Does anyone have any idea of how to go about this if I assign the body to a variable 
like so?

$msgbody = $pop->Body($i)   # $pop being the instantiated POP connection object

Thanks,
Vincent

Reply via email to