The blank line on line 7 could be what is preventing the redirect. Redirects can't happen after the page starts to render even if it is just a blank line that is written. Try deleting that line.
You should also remove the go to page in the second update server behavior and put it in the email instead since you don't want it to redirect until after the email is sent.