Your link makes no sense. And what do you mean "how"? By looking at what your Web service offers and using it.
The question should assume that you have some WebService which can send a mail in response to some HTTP request. (Please see my comment to the question; probably, you don't have it yet. :-)) It means that all you need is to send appropriate request. With JavaScript, it will be based on AJAX:
http://en.wikipedia.org/wiki/Ajax_(programming)[
^].
You can write such request yourself, or it can be facilitated by one or another available library, for example,
http://api.jquery.com/jquery.ajax[
^].
That's all.
—SA