Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should mailto be used in HTML5?

A year or so ago I decided to stop using the mailto tag because many times it is annoying to the user. It will bring up an email program that the user may not be using at the time, which may also take time to load and may not be what the user wanted to do when he/she clicked on what looked like a link.

Instead I decided to just start displaying the email address without the mailto tag. I believe that both ways probably can produce spam.

My questions are these, Is the mailto tag the accepted way to setup email links, or do good people/companies avoid them? Second, if they both create spam, is there a way to prevent spam from being generated on either? I have seen the mailto being put inside comments somehow, but it seems kind of a hacked way of doing it.

like image 487
Metropolis Avatar asked Nov 10 '10 03:11

Metropolis


People also ask

Should I use mailto links on my website?

A mailto link is different than a contact form link. Essentially, an HTML mailto link is a link that triggers the user's default mail client to open so they can reply to a message. If you're a fan of email HTML forms and know your way around the coding aspect of things, a mailto link can be preferable, in some cases.

Is mailto still used?

they're used everywhere—so people may be expecting the behaviour they're used to. on mobile devices, users pretty much have to set up a default email address, so clicking this link does exactly what most mobile users intend: it opens up their compose dialog.

What is the use of mailto in HTML?

What is a Mailto Link in HTML? Mailto links are used to redirect the user to an email address instead of a link. When the user clicks on a mailto link, the default email client opens on the user's computer and suggests sending an email to the address included in the mailto link.

Why mailto is not working in HTML?

If mailto links don't open for you the way they should, a quick look at the system or browser settings should do the job. In Windows, head to Settings -> Apps -> Default apps. Scroll down and pick “Choose default apps by protocol” from the menu. For 'Mailto', choose the client of your choice.


1 Answers

You should use the mailto: URI scheme in both HTML4 and HTML5.
If the user doesn't want a mail client to load, he won't click the link.
Not using mailto: just makes it more annoying to send you email.

Any half-decent (indecent?) spam crawler will pick up email addresses whether or not they're in mailto:.

One effective way to prevent this is to include a (trivially-)encrypted version of the email address in Javascript and write it into the document.
This way, any spam crawlers that do not execute Javascript won't get your address.
If you're afraid of spam crawlers that do use Javascript, you can only write the email address on mousemove and/or after 5 seconds.
For accesibility reasons, and for humans with Javascript disabled, you may want to include a scrambled form of the address in plain text. (eg, SLaks (SHIFT+2) MyDomain (period) com)
You can write a server-side script to generate this automatically for an email address.

For obvious reasons, I won't share code. (In order for this to work well, each site should have a different implementation)

like image 85
SLaks Avatar answered Sep 25 '22 06:09

SLaks