40 lines
909 B
PHP
40 lines
909 B
PHP
<?php header('Content-type: application/json');
|
|
$em="";
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/mailservices/includes/');
|
|
include(PATHTOINCLUDES."base.php");
|
|
$imapuid=$_GET["muid"];
|
|
$dbcon=dbconnect2();
|
|
$em="Failed";
|
|
$sql="SELECT
|
|
`mail_accounts`.`maid`,
|
|
`mail_accounts`.`username`,
|
|
`mail_accounts`.`password`,
|
|
`mail_accounts`.`host`,
|
|
`mail_accounts`.`port`
|
|
FROM
|
|
`mail_accounts`
|
|
WHERE `mail_accounts`.`maid`=".$_SESSION["inbox_maid"];
|
|
$result=mysql_query($sql) or $em=$em.mysql_error();
|
|
$m=mysql_fetch_assoc($result);
|
|
if (($mbox = imap_open("{b8world.com:143/novalidate-cert}INBOX", $m["username"], $m["password"])) !=false)
|
|
{
|
|
$move="INBOX.Trash";
|
|
if(imap_mail_move ( $mbox , $imapuid , $move, CP_UID))
|
|
{
|
|
imap_expunge($mbox);
|
|
imap_close($mbox);
|
|
$em="Success";
|
|
}
|
|
}
|
|
else {
|
|
$em="Failed";
|
|
}
|
|
$arr = array ('result'=>$em);
|
|
echo json_encode($arr);
|
|
?>
|
|
|
|
|
|
|
|
|
|
|