Location: PHPKode > projects > MyMail Webmail > delete.php
<?php

// delete.php - delete messages

// session check
session_start();
if (!session_is_registered("SESSION"))
{
	header("Location: error.php?ec=2");
	exit;
}

// open POP connection
$inbox = @imap_open ("{". $SESSION_MAIL_HOST . "/pop3:110}", $SESSION_USER_NAME, $SESSION_USER_PASS) or header("Location: error.php?ec=3");

// delete specified message numbers
for($x=0; $x<sizeof($dmsg); $x++)
{
	imap_delete($inbox, $dmsg[$x]);
}

// clean up and go back to list page
// can also use imap_expunge() here
imap_close($inbox, CL_EXPUNGE);
header("Location: list.php");
?>
Return current item: MyMail Webmail