Location: PHPKode > projects > Myphpim > MyPhPim-01.05/download.php3
<?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
//**************************************************************************************** 

include "conf/imap_conf.inc";
include "includes/imap_cl.inc";
include "includes/mysql_cl.inc";
include "includes/mcrypt_cl.inc";

session_start();

$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 );
Header ( "Content-type: application/octet-stream" );
Header("Content-Disposition: attachment; filename=" . $filename);
$text = imap_fetchbody ( $stream, $msgno, $part );
if ( $encoding ) {
	switch ( $encoding ) {
		case "BASE64":
			$att = imap_base64 ( $text );
			break;;
		case "QUOTED-PRINTABLE":
			$att = imap_qprint( $text );
			break;;
	}

}

echo "$att"; 
$imap2->close ( $stream );

?>
Return current item: Myphpim