are you using a cgi mail script like 'formmail.cgi'?
The above php example and other ways would be simpler, but if limited to cgi access and knowledge of the formmail.cgi stuff it can still be done easily.
If so, the formmail script should have a redirect 'target' value that can be set, which can be set to the NAME of a new window you can pop up during the submit process. The scripts default target is the self window which is why you get the thankyou wiping out your page.
If so, change the onsubmit function in your mail form html to a function that pops open the window you want and NAME it, ie: mailWin=window.open("", "mailsent", WinProps); where 'mailsent' becomes the new windows name. In that function immediately after the new window pop, let the submit go, don't forget the 'return true' at the end. Now in the formmail script itself add a line, or in the mail form itself set a hidden value of 'target="mailsent"'.
An example, my site uses a little palmtop as the user interface, and on submit of mail I needed the sent confirmation (the thankyou) to return in the palm top screen ( an Iframe, just like a new window, with a name=target), instead of wiping out my palmtop completely with a thankyou page replacing it! I did use the typical formmail.cgi with these modifications.
http://www.choicenames.com/index.html?mail
good luck.