in reply to generate mailto: behaviour in a script

To get the response you are outlining, it seems that you need a javascript onclick solution with DHTML communication (a.k.a. AJAX) with the server. You can then acquire the click data through a hidden process, and allow the client to continue with the browser based email client.