IMAP get entire message

Hi all,
Ive been struggling with this for a while, so hopefully someone can help.

This is a very simple script using PHP imap functions to read a mailbox. Is there a function I can use to get the entire source of the message (the same as I would see if I was viewing the source in outlook etc). So for a mime message I would get the entire thing, headers and everything?

I've had some luck using an email "pipe" script to access all of the inbound messages for a given email address. The server associates the pipe with an email address and instead of putting the messages into an inbox, the server starts the pipe script. The pipe reads the email from STDIN. Each line of the input looks exactly like what you would expect to see if you did "view source" and read the text a line at a time.

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.
(CODE)
(CODE)
Then you just need to pass your date to the function.
If i…