// Output Time..
foreach($pmessages as $msg)
{
// Stuff we need to set.
$rcp_start = true;
$labl_start = true;
// Start Output..
echo '
From: ', $msg['from']['name'], ' (ID: ', $msg['from']['id'], ')', $crlf,
'To: ';
// For Everyone it went to besides BBC (Cuss you shouldn't know) tell us
foreach ($msg['recipients']['to'] as $rcp)
echo ($rcp_start ? ($rcp_start = false) : ', '), $rcp['name'], ' (ID: ', $rcp['id'], ')';
// Folders are next
echo $crlf,
'Folders: ';
// For every folder we tell.
foreach ($msg['labels'] as $labl)
echo ($labl_start ? ($labl_start = false) : ', '), $labl;
echo $crlf,
'Sent: ', $msg['sent'], $crlf,
'Subject: ', $msg['subject'], $crlf,
$msg['body'];
echo $crlf,$crlf;
}