Please Note : imap_headerinfo only returns a subset of the headers, rather than the entire thing.
Among other things, this means it only shows the first recipient from the "to" section of the email, rather than all recipients.
If you're not seeing something you expected to, you'll be better off using
$hdr_raw = imap_fetchheader($mbox, $mailid);
$hdr = imap_rfc822_parse_headers($hdr_raw);
then you'll see the full set of headers, and be able to do more with it.