<?php
//****************************************************************************************
// Copyright (C) 2000 Koen de Boeve
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Version : MyPhPim-01.05
// Author : Koen de Boeve
// Contact: hide@address.com
//****************************************************************************************
session_start();
include "conf/imap_conf.inc";
include "includes/imap_cl.inc";
include "includes/mysql_cl.inc";
include "includes/mcrypt_cl.inc";
$db = new DB;
$userdata = $db->Fetch_login ( $user, $choosehost );
$login = $userdata[0];
$pass = $userdata[1];
$proto = $userdata[2];
$host = $userdata[3];
$port = $userdata[4];
$imap2 = new ImapCl;
$stream = $imap2->InitFolder ( $host, $port, $proto, $login, $pass, $folder );
if ( $part_no == "1" ) {
$part = $part_no;
} else {
if ( strpos ( $part_no, "." ) ) {
$tmp = explode ( ".", $part_no );
$counttmp = count ( $tmp );
for ( $i = 1; $i < $counttmp; $i++ ) {
if ( $i == 1 ) {
$part = $tmp[$i];
} else {
$part = $part . "." . $tmp[$i];
}
}
}
}
$text = imap_fetchbody ( $stream, $msgno, $part );
switch ( strtoupper ( $encoding ) ) {
case "BASE64":
$tmp = imap_base64 ( $text );
$text = $tmp;
break;;
case "QUOTED-PRINTABLE" :
$tmp = imap_qprint ( $text );
$text = $tmp;
break;;
}
$stripped = explode ( "</html>", $text );
if ( $stripped[0] != "" ) {
echo "$stripped[0]";
echo "</html>\n";
} else {
echo "$text";
}
$imap2->close ( $stream );
?>