Hide mail address in html

There are a few ways to hide a mail address in HTML, depending on your specific needs and the level of security you require. Here are a few options:

  1. Use a mailto link with a JavaScript function: You can create a mailto link that calls a JavaScript function to hide the email address. Here's an example:
    
    <a href="javascript:emailMe('[email protected]')">Contact me</a>
``` In this example, the `emailMe` function creates a new mailto link with the hidden email address and appends it to the page. When the link is clicked, the email client will open with the hidden email address.
  1. Use a mailto link with a CSS class: You can add a CSS class to the mailto link to hide it from view. Here's an example:
    
    <a href="mailto:[email protected]" class="hidden">Contact me</a>
``` In this example, the `.hidden` class sets the position of the link to absolute and moves it off the screen, effectively hiding it.
  1. Use a mailto link with a server-side script: You can use a server-side script to generate a mailto link with a hidden email address. For example, you can use PHP:

    <a href="mailto:<?php echo $_GET['email'];?>">Contact me</a>

    In this example, the PHP script generates a mailto link with the email address passed as a GET parameter.

  2. Use a third-party service: There are several third-party services that can help you hide your email address, such as Gravatar or ReCaptcha. These services can generate a unique email address for each user and forward emails to your actual email address.

Remember to always validate any user input before using it to generate a mailto link, to prevent potential security vulnerabilities.