Prompt Detail:
To avoid getting spammed while citing an email address like [email protected] on a public website, you can use the following methods:
- Use an email obfuscator: An email obfuscator is a tool that converts your email address into a code that can be read by humans but not easily parsed by spam bots. For example, you can use a JavaScript-based email obfuscator or HTML character entities to display the email address on the website. Example:
html<!-- JavaScript-based obfuscator -->
<script type="text/javascript">
document.write('dataprotection' + '@' + 'XYZ' + '.' + 'ABC');
</script>
<!-- HTML character entities -->
dataprotection@XYZ.ABC
Display the email address as an image: Create an image that contains the email address, and place it on the website. Bots cannot read text from images easily. However, this method may not be accessible to visually impaired users or compatible with screen readers.
Use a contact form: Instead of displaying the email address, use a contact form that allows users to send messages without revealing the email address. The contact form can send messages to the email address behind the scenes, keeping it hidden from spam bots.
Use a reCAPTCHA or other anti-spam measures: Implementing reCAPTCHA or other anti-spam measures in your contact form can help prevent automated spam messages from reaching the email address.
Use a mailto link with a custom subject line: This method does not hide the email address, but it can help filter spam messages. Add a specific subject line to the mailto link (e.g., "Contact from Website") and set up an email filter to separate messages with this subject line. Example:
html<a href="mailto:[email protected]?subject=Contact%20from%20Website">Email us</a>
Keep in mind that no method is foolproof, but combining multiple approaches can help reduce the likelihood of your email address being discovered by spam bots.