<?php include_once "imap.inc.php"; include_once "mimedecode.inc.php"; $imap = new IMAPMAIL(); if (!$imap->open("192.168.0.26", "143")) { echo $imap->get_error(); exit; } $imap->login("harishc", "hchauhan"); echo $imap->error; $response = $imap->open_mailbox("INBOX"); echo $imap->error; //echo $response=$imap->get_msglist(); //echo $response=$imap->delete_message(9); //echo $response=$imap->rollback_delete(9); $response = $imap->get_message(1); ///Decoding the mail $mimedecoder = new MIMEDECODE($response, "\r\n"); $msg = $mimedecoder->get_parsed_message(); print_r($msg); //echo nl2br($response); echo $imap->get_error(); $imap->close(); //$response=$imap->fetch_mail("3","BODYSTRUCTURE"); //print_r($response); //echo nl2br($response); //echo $imap->error; echo "<br>";
$email = ""; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); */ //calling get_parsed_message of the mimedecode object //will return text part of the message, which also fills //attachment,header arrays of the mimedecode object // will get the message body with html tags if any at $var_message_main, // _mailheader attribute of mimedecoder will contain the header of the message // _header attribute of mimedecoder will contain the header as a string // _attachments attribute will contain all the attachments //echo "\n CONTENT DISPLAY"; $mimedecoder = new MIMEDECODE($email, "\r\n"); $var_message_main = $mimedecoder->get_parsed_message(); /*$myFile = "/temp/testing.txt"; chmod($myFile,0777 ); $fh = fopen($myFile, 'w+') or die("can't open file"); fwrite($fh, $var_message_main ); fclose($fh);*/ //included to remove htmlcharacters,and other characters /* $search = array ('@<script[^>]*?>.*?</script>@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@([\r\n])[\s]+@', // Strip out white space '@&(quot|#34);@i', // Replace HTML entities '@&(amp|#38);@i', '@&(lt|#60);@i', '@&(gt|#62);@i', '@&(nbsp|#160);@i',
require_once("./program/lib/imap.inc.php"); require_once("./program/lib/mimedecode.inc.php"); $imap = new IMAPMAIL; $imap->open($bloggy_config['imap_host'], $bloggy_config['imap_port']); $imap->login($bloggy_config['imap_user'],$bloggy_config['imap_pass']); $imap->open_mailbox($bloggy_config['imap_folder']); if($imap->get_msglist() > 0) { $mimedecoder=new MIMEDECODE($imap->get_message(1),"\r\n"); $data = parse($mimedecoder->get_parsed_message()->parts['0']->body, true); if($data['password'] == $bloggy_config['mail_pass']) { //If the passwords match, lets continue! $data['password'] = null; $data = array_filter($data); $post = ""; foreach($data as $key => $value) { $post .= $key.": ".$value."\r\n"; } $dirlistnormal = getDirectoryList('./posts');