Matt's FormMail, and all of Matt's scripts, have extreme security problems, huge holes...massive problems. They always have...try and avoid using them entirely, or make sure you can plug the holes yourself.
As for the redirection, it depends on how your script is setup. As has been pointed out, you can call another sub or another block of code that would redirect by printing HTTP EQUIV headers or JavaScript redirects, but why even do that?
You also could do a redirect that is pure cgi and much faster (and not depending on the way the user has their browser setup).
print "Location : http://www.yoursite.com/thankyou\n\n;"
And note that you would have to make sure that this line of code is executed without the content type of text/html or it will just print that line to the client.
I've attached a script that I used to use a while back...