Forum Moderators: open
I have never tried it and I don't know how the various browsers will react, but why don't you reverse the process. Let the link go to your script, and when the script is done, send a redirect to a mailto url.
It is just an untested idea, but maybe worth trying.
Otherwise you're in for some javascript and (i)frames fiddling. You could place a really small iframe somewhere on the page, and have the onClick handler submit a form into that iframe. That way you get the mailto link and a script activated on the server side. It'll cost you a superflous iframe, that only serves as the client side target for the output of the script, which could always be a 204 HTTP response (No change).
I hope this helps you.
René.
<script>
function emailLoads(){
window.location = "mailto:whatever@whatever.com";
window.location = "#open-mail-and-new-page";
}
</script>
<a href="javascript:emailLoads()">email me</a>
this worked in IE6 didn't test it anywhere else. This allows the mailto to open and hit the server for the server-side code.