Ask HN: What is the safest way to put an Email address on my website in 2021?
1–10 of 17 posts
No post body was provided.
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#2Assuming this is your personal website, a form with a captcha should suffice. Ensure the form limits the input to printable text and limit how often the form may be used by IP and globally. Captcha doesn't need to be a third party. It can be a simple math problem or a simple logic question or even "What is in the picture below?" and have a picture of a horse. Why a form? So people don't get your real email address and you have the option to only view the messages on your website at your leisure. Legit users will leak their contacts when they get malware on their system.
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#3I am assuming you want to deter bots from scrapping your website to get your email address and spam you.
I suggest using something like “you can reach me at filipo [at] this domain name.”
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#4I am assuming you want to deter bots from scrapping your website to get your email address and spam you. I suggest using something like “you can reach me at filipo [at] this domain name.”
Honest Q: isn't it trivial to scrape the "filipo [at] domain" email address either? I see lots of websites use something like this, and it seems an easy enough task to write a RE that can figure out a valid address from it.
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#5Base64 encode it.
If someone wants to send you email, he should be able to decode your address.
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#6display your email address as an image
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#7I recently went with an SVG of the email address, with vectors and not text of course.
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#8Using a contact form that sends you an email server-side is a good one, that way they never have your email (unless you respond).
I also had a static website at one point where I didn't want to add server-side processing for a contact form so I stored the email address obfuscated in javascript like:
["m","o","c",".","l","i","a","m","e","@","e","m"].reverse().join('')
and injected it into the page. It seems that most scraper bots don't execute javascript and with it split into an array they likely won't find it by scraping the js files either.Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#9display your email address as an image
This would present an accessibility problem for people using screen readers, unless you provide your email address as alt text (which a scraper could pick up, defeating the purpose).
Re: Ask HN: What is the safest way to put an Email address on my website in 2021?
#10Base64 encode it. If someone wants to send you email, he should be able to decode your address.
Well, if a programmer wants to send you email... Everybody else will have no idea what to do with it.