Files
Testing/mailservices/bateworld/mail/trash_message.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

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);
?>