$query = mysql_query("DELETE FROM mail WHERE id='$id'");
Also, instead of setting the $_SESSION array values to "", maybe look into [man]unset()[/man]. Just be sure to handle the unset properly if your Register Globals is on... (See the user notes in the manual there)