Codice PHP:
<center><h1>Guglio.net Mail</h1><br/><br/><br/>
<?
$pop3="mail.guglio.net";
$username="*******@guglio.net";
$password="********";
$conn = imap_open("{".$server.":110/pop3}INBOX",$username, $password);
$n_messaggi = imap_num_msg($conn);
$messaggi = imap_fetch_overview($conn,"1:$n_messaggi");
while(list($key,$value) = each($messaggi))
{
for($m=$messaggi_totali; $m>0; $m--){
$headers=imap_header($conn, $m);
$mittente= $headers->fromaddress;
$a = $headers->toaddress;
$dati = explode("@",$a);
//if ($dati[0]==$_GET['mail']){
print($dati[0]);
$oggetto=$headers->subject;
$data=date("j/n/Y G:i:s",strtotime($headers->date));
?>
<div id="spoiler">
<div><font size="4"></font><input type="button" value="<?=$mittente?> | <?=$oggetto?>" style="width:850px; font-size:14px; margin-left:10px; margin-bottom:3px; padding:0px; background: url(http://forum.guglio.net/images/gradients/arancione.png); color: #0F3;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = ''; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = 'none'; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')['show'].style.display = 'none'; this.parentNode.parentNode.getElementsByTagName('div')['hide'].style.display = ''; this.innerText = ''; this.value = '<?=$mittente?> | <?=$oggetto?>'; }" />
<div id="show" style="display: none; background-image: url(http://host.guglio.net/spoiler.gif); background-repeat:repeat; margin: 0px;border-style:solid;border-width:1px; padding: 4px; width:98%">
<?
echo "<b>Mittente:</b> $mittente<br/>";
echo "<b>Oggetto:</b> $oggetto<br/>";
echo "<b>Data:</b> $data<br/><br/>";
echo nl2br(imap_fetchbody($conn,1,"1", "FT_PEEK"));//<--------------------------------
?>
</div>
<div id="Nascondi"></div></div></div><br/><br/>
<?
// }
}
}
imap_close($inbox);
?>
</center>
Ho messo una "<-----" dove c'è il problema
Warning: imap_fetchbody(): supplied argument is not a valid imap resource in /home/guglione/domains/guglio.net/public_html/forum/mail.php on line 31