problem imap_headerinfo

[email protected] (Richard Kurth)
Newsgroups php.general
Message-ID <[email protected]>
 I get a *Catchable fatal error*: Object of class stdClass could not be 
converted to string  on this line  $mail_head = imap_headerinfo($conn, $i);
if I remove it it works fine what would be casing this I really need to 
read the header. I am using php version  5.2.5

$conn = @imap_open("{" . $bouncer['host'] . ":" . $bouncer['port'] . "/" 
. $bouncer['mailtype'] . "/notls}" . $bouncer['mailbox'], 
$bouncer['username'], $bouncer['password']);
     $headers = @imap_headers($conn);
        if ($headers) {
          $email_count = sizeof($headers);
          for($i = 1; $i <= $email_count; $i++) {
               # Check the body against all saved patterns
               $mail_head = imap_headerinfo($conn, $i);     
               $mail_body = imap_fetchbody($conn, $i, 1);
                echo "mail head: $mail_head<br>\n";
                echo "mail body: $mail_body<br>\n";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.