What I want is that i can have a link <a> with an onclick, and when the person clicks it, an email gets sent to $email with a certain message. I can send messages in PHP, that's not the problem, but I wan't do it in javascript, and even if I could I wouldn't be able to do it safely.
Use AJAX. Make a request to php script, it will send email and returns some answer. Make a hook, to show message on getting reply from php script.