Hi all,
I'm trying to build a script that will read mail from the server, and have the following code:
<?php
$MAILSERVER="{localhost/imap}";
$link=imap_open($MAILSERVER,$PHP_AUTH_USER,$PHP_AUTH_PW);
$header=imap_header($link,$num);
echo $header[fromaddress];
echo "To: $header[toaddress]<br>";
echo "Date: $header[Date]<br>";
echo "Subject: $header[Subject]<br><br>";
echo imap_body($link,$num);
?>
However, I'm presented with the following error:
Fatal error: Cannot use object of type stdClass as array in /home/mysite/public_html/folder/mail/view.php3 on line 7
Would anyone be able to help here?
Cheers,
Mike