i concur with jay that http_post_vars may be deprecated, i do not understand that you used $_POST for database insertion and not for storing into variables, and you are doing double the work, here is how i would code it:
<?php
$con = mysql_connect("localhost","me","mypassword");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("final_project", $con);
$username = $_POST['Username'];
$email = $_POST['email'];
$Firstname = $_POST['Firstname'];
$Lastname = $_POST['Lastname'];
$Issue = $_POST['Issue'];
$Category = $_POST['Category'];
$Dept = $_POST[Department];
$sql="INSERT INTO Persons (Username,FirstName, LastName, Department,Issue,Category)
VALUES
('".$username."', '".$Firstname."','".$Lastname."','".$Dept."','".$Issue."','".$Category."')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con)
if( mail($email,$Firstname,$Lastname,$Issue,$Category)){
print ("your mail was sucessfully sent to $email");
}else
print "unable to send mail to $email";
echo "<br>";
echo "You records have been updated";
?>
check your code against this code. You had a $to variable which was not assigned anything, you should also sanitize your inputs, use functions such as trim, addshashes and strip_tags, hope you get it sorted