I have a website with a minimal, client-side HTML-CSS-JavaScript contact form but I desire to hide the destination email address of that form from the HTML source code so that form users would not be able to find it in HTML source codes from their web browsers.
I considered putting the destination email address in a configuration file and refer this configuration file somehow but the reference itself might appear in source code and expose the file containing the email so people could browse that file and find the email address.

What is the standard or common way to secure a destination email address of a client-side contact form?

  • 1
    "What is the standard or common way to secure a destination email address of a contact form?" is server side a valid answer..?
    – 102764
    Commented Sep 18, 2019 at 21:26

1 Answer 1


You can't create a client side contact from that doesn't leak your contact details. It isn't possible.

The standard way of doing this is to have your server send the email to after a form submission. In addition the server side script can be configured with anti-bot measures such as:

  • Never showing your email address to clients
  • Hidden fields that bots don't know to leave blank
  • Captcha
  • Disallowed keywords and formatting

I've written contact form software that does all this: https://ostermiller.org/contactform/ You can also find anti-spam contact form plugins for most content management systems. If I recall form your other posts, you use MediaWiki, so you might be interested in https://www.mediawiki.org/wiki/Extension:ContactPage


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.