I'm not 100% positive, but I am pretty sure the Onclick event can not execute php code. So whatever you are including in trial.php would not work...
I've thought and though about this one and I don't know if you can accomplish both of the items that you want to do with one user click...It's kind of a strange combination of actions....
Having someone click to send an e-mail and update a database when they do so.
If you really wanted to, I guess you could set up a simple form with a "from", "to", "subject", "message" fields that they would fill out like they would an e-mail.
Then you could post that form to a script and use the mail() function to send and e-mail, and update your database...? But that would force them to actually send an e-mail, where as the "mailto" just opens up their mail client...