fetch_array($mailInfo);
if($temprow["mail_protocol"] == 'POP')
{
$ServerName = "{".$temprow["mail_servername"]."/pop3:110/notls}INBOX";
}
else
{
$ServerName = "{".$temprow["mail_servername"]."/imap:143/notls}INBOX";
// For a IMAP connection (PORT 143)
}
$UserName = $temprow["mail_username"];
$PassWord = $temprow["mail_password"];
$mbox = imap_open($ServerName, $UserName,$PassWord) or die("Could not open Mailbox - try again later!");
if ($hdr = imap_check($mbox)) {
echo "Total Messages :-> " . $hdr->Nmsgs ."\n\n
";
$msgCount = $hdr->Nmsgs;
} else {
echo "failed";
}
$MN=$msgCount;
$overview=imap_fetch_overview($mbox,"1:$MN",0);
$mime_type = get_mime_type($overview);
//$size=sizeof($overview);
$size = imap_num_msg($mbox);
global $app_strings,$current_user;
if(isset($_REQUEST['view']) && $_REQUEST['view']!='')
{
$msgid = $_REQUEST['view'];
$header = @imap_headerinfo($mbox, $msgid, 80, 80);
$fromaddress[$msgid] = $header->from[0]->host;
$domain = $fromaddress[$msgid];
$fromname[$msgid] = $header->from[0]->mailbox;
$sendername=$fromname[$msgid];
$from[$msgid]= $fromname[$msgid]."@".$fromaddress[$msgid];
$totalfromaddress = $sendername ."@".$domain;
$val=$overview[$msgid-1];
$msg=$val->msgno;
$from=$val->from;
$date=$val->date;
$subj=$val->subject;
//transformHTML($subj);
$seen=$val->seen;
$from = ereg_replace("\"","",$from);
echo '';
// MAKE DANISH DATE DISPLAY
list($dayName,$day,$month,$year,$time) = split(" ",$date);
$time = substr($time,0,5);
$date = $day ." ". $month ." ". $year . " ". $time;
if ($bgColor == "#F0F0F0") {
$bgColor = "#FFFFFF";
} else {
$bgColor = "#F0F0F0";
}
if (strlen($subj) > 60) {
$subj = substr($subj,0,59) ."...";
get_part();
}
echo get_module_title("Emails",'Emails', true);
echo "
";
echo "