Let's see how to create HTML links to email addresses, skype accounts, phone and fax numbers that, once clicked, offer the user to open them with the appropriate application.
These links are similar to classic HTML links, made with the tag
<a href="#">Text</a>attribute, with the difference that the data transmitted in the href are composed of a prefix (mailto, tel, callto or fax) followed by the contact identifier (e-mail address, skype identifier, telephone number or fax number) separated by a colon (": ").
HTML links to email addresses
Let's start with the most classic, the email address. The prefix to use is "mailto:" followed by the email address.
But it is possible to go much further by using the following parameters in the URL :
- subject : Subject of the mail
- cc: Recipients in carbon copy
- bcc: Recipients in blind carbon copy
- body: Corp du mail
Here is an example of their use:
HTML links to phone numbers
For links pointing to a telephone number, the prefix to be used is "tel:" followed by the telephone number and its area code. In France, the prefix to use is +33. For other countries, here is the list of international phone codes. To add the code to a national telephone number (10 digits), simply replace the first zero ("0") with the appropriate international code. Links to phone numbers are very useful on smartphones.
HTML links to fax numbers
The prefix to be used is "fax:" As with links to telephone numbers, the fax number used must begin with the international dialling code.
HTML links to Skype accounts
The prefix to use when linking to a Skype Name is "callto:" These links launch Skype, the popular instant messaging and video calling software, on computers and mobile devices where it is installed.
HTML links to TeamSpeak 3 servers
It is also possible to create links for the TeamSpeak 3 software with the information of the target server as parameters. By default, the link used must be composed of the server address and the port of the server. But it is possible to pass many more parameters in this URL, as shown below.
As with links pointing to email addresses, links pointing to a TeamSpeak server can contain settings. These settings are as follows:
- port: Number of the port to be used to connect to the server.
- nickname: Name to use and display
- password: Password
- channel: Channel name (chat room)
- cid: Specify the channel with an ID
- channelpassword: Channel password
- token: Connection key
- addbookmark: Name to give for the server in the teamspeak client favorites
These additional parameters are used as follows.
Note that if you use the "cid" parameter in the server URL, then the "channel" parameter can be ignored.