Skip to content

Cookie settings

Choose which kinds of cookies you allow. You can change your choice at any time via Cookie settings at the bottom of every page. Privacy statement

Necessary

Always on

Needed to log in, keep your cart and remember your choices. These are always on.

Which cookies?
  • weboke_sessie, weboke_klant, weboke_remember: your session and staying logged in
  • weboke_basket: your cart
  • wkBtwIncl: showing prices with or without VAT
  • wok_cookies: your cookie choice, 12 months

Measures which ad leads to a visit or order, so we do not pay for ads that do nothing.

Which cookies?
  • Google Ads via Google Tag Manager (_gcl_au, _gcl_aw), up to 90 days
  • OpenAI Ads, ads in ChatGPT
  • wok_aff: which partner referred you to us (affiliate programme), 60 days

4.6

Country and language

Each country has its own site, with prices and VAT for that country.

View

A contact form on your website: have fields emailed and prevent spam

Do you want visitors to be able to email you through a form on your website? In this article you'll read how to create such a form, how to protect it against spam, and how to make sure the mail arrives properly.

Creating a form

  • WordPress: use a form plugin, such as Contact Form 7. You don't need to do any programming yourself. A paid plugin isn't necessary.
  • Your own HTML or PHP site: search for "creating an HTML form" for free examples. Have the form send via SMTP, not via the PHP function mail() (see below).

Preventing spam through your form

A form without protection is almost certainly going to be found by spambots. This means you'll receive a lot of spam, and in the worst case your form gets abused to send spam to others. So always protect your form:

  • Captcha: a check that distinguishes humans from bots, such as Google reCAPTCHA or Cloudflare Turnstile. Contact Form 7 works with reCAPTCHA. For Turnstile you install a separate plugin, for example Simple Cloudflare Turnstile.
  • Honeypot: a hidden field that humans don't see, but bots do fill in. If the field is filled in, the message isn't sent. There are also small plugins for this.
  • Forums and blogs: for a lot of forum and blog software there's an integration with Stop Forum Spam. This keeps a list of IP addresses that send spam and blocks messages from those addresses.
  • Keep your website up to date: keep WordPress, your theme, and your plugins updated at all times. An outdated plugin is a commonly used entry point for abuse.
The Web Application Firewall is also enabled on your hosting package. This blocks known attacks via forms. Leave it on. A captcha is still needed, though, because the firewall doesn't recognize every spam message.

Making sure mail from your form arrives properly

  • Send via SMTP. With mail() in PHP, the sender becomes an address with the account name of your package, and you can't change that. Such mail often ends up in spam. Via SMTP you log in with a real mailbox and determine the sender yourself. In WordPress you use an SMTP plugin for this, such as WP Mail SMTP. For your own PHP script, read How can I get the correct sender with mail() in PHP?.
  • Sender on your own domain. Have the form send mail from an address on your own domain, for example info@yourdomain.nl. Never use the visitor's email address as the sender: many recipients will then reject the mail. Put the visitor's address in the Reply-To field, then you can simply reply to the message.
  • The SMTP details: the server name of your package, port 587 with STARTTLS or port 465 with SSL/TLS, and the email address and password of the mailbox. See All settings at a glance.
Is your email hosted with Microsoft 365 or Google Workspace? Then a checkbox in DirectAdmin needs to be unchecked, otherwise mail from your form won't arrive. See Sending mail via PHP doesn't work, the MX records point elsewhere.

Is your form already being abused?

Are you receiving a lot of mail back that you didn't send, or is the server reporting that your sending limit has been reached? Then your form might be being abused. Read What to do if your email address has been abused and Sending limits and the "message limit reached" notification.

Was this article helpful?

← Back to Other

One moment…

Set up your domains

For each domain, arrange the nameservers, the link to your hosting and who becomes the owner.

Loading your domains…