One way to do it would be to create a flag variable right after your insert SQL statements and then add that parameter to the trigger of the email manually.
So in the block of your insert it looks like this:
if (Submit Pressed Trigger) {
sql inset lines;
sql insert lines;
$inserted = "yes";
}
I created a variable called "$inserted" before the closing bracket...
then, in your email trigger, modify it to look like this
if (SubmitPressed && $inserted == "yes") {
Email stuff here
}
By using the "&&" it means both conditions must validate as true and then use "==" to test equality.
Best regards,
Brian