$sendmail = "INSERT into Setro_Mail (to, from, subject, message) value ('$to', '$username', '$subject', '$message')";
You aren't actually running that, it's just setting it into a variable. Try:
$sendmail = mysql_query("INSERT into Setro_Mail (to, from, subject, message) values('$to', '$username', '$subject', '$message')");
To get a link to delete something, I use something like this:
Page1:
// Show the link, with a query string to pass a value (in this case it's msg_id, which I'm using as an example of a unique identifier)
echo "<a href=\"delete.php?msg_id=$msg_id\">Delete this message</a>";
Page2:
if(isset($_GET['msg_id'])) {
// clean up the url passed data, so it's not malicious
$msg_id = addslashes(trim($msg_id));
// Create the query
$sql = "DELETE FROM table WHERE msg_id=$msg_id";
// Run the query
$result = mysql_query($sql, $db);
} else {
// If msg_id isn't set, then send the user back to the index
header("Location: index.php");
exit;
}
Hope that helps,
Matt