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: emailing the fields and preventing spam

Want visitors to be able to email you through a form on your website? This article explains how to create 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, and you don't need a paid plugin.
  • Your own HTML or PHP site: search for "create HTML form" to find free examples. Have the form send its mail via SMTP, not via the PHP function mail() (see below).

Preventing spam through your form

A form without protection will almost certainly be found by spambots. You'll then receive a lot of spam, and in the worst case your form will be abused to send spam to others. So always protect your form:

  • Captcha: a check that tells humans and bots apart, such as Google reCAPTCHA or Cloudflare Turnstile. Contact Form 7 works with reCAPTCHA. For Turnstile, install a separate plugin, for example Simple Cloudflare Turnstile.
  • Honeypot: a hidden field that people don't see, but bots do fill in. If the field has been filled in, the message isn't sent. There are small plugins for this as well.
  • Forums and blogs: a lot of forum and blog software has an integration with Stop Forum Spam. It keeps a list of IP addresses that send spam and blocks messages from those addresses.
  • Keep your website up to date: always update WordPress, your theme and your plugins. An outdated plugin is a common entry point for abuse.
Your hosting package also has the Web Application Firewall enabled. It blocks known attacks through forms. Leave it switched on. You'll still need a captcha, though, because the firewall doesn't recognise every spam message.

Comments on your blog or in your forum

Spambots don't just post messages through forms, they also post comments with links, hoping search engines will count those links. Here's how to prevent that:

  • Have comments approved first. In WordPress, go to Settings › Discussion and enable the option that a comment must be manually approved. If you don't use comments, switch them off completely.
  • Use an anti-spam plugin or captcha for comments, just like for your form.
  • Mark links in comments. Links that visitors post themselves should have rel="ugc" or rel="nofollow". That way search engines know you don't vouch for that link. WordPress has done this automatically since version 5.3. For other software, check the settings or look for a plugin.

How to make sure the mail from your form arrives properly

  • Send via SMTP. With mail() in PHP, the sender becomes an address with your package's account name, and you can't change that. Mail like this often ends up in spam. With SMTP, you log in with a real mailbox and choose the sender yourself. In WordPress, use an SMTP plugin for this, such as WP Mail SMTP. For your own PHP script, read How do I get the right 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.com. Never use the visitor's email address as the sender: many recipients will reject the mail. Put the visitor's address in the Reply-To field, so you can simply reply to the message.
  • The SMTP details: your package's server name, 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 you need to untick a checkbox in DirectAdmin, otherwise the 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 getting lots of bounced mail you didn't send, or is the server reporting that your sending limit has been reached? Then your form may be being abused. Read What to do if your email address has been abused and Sending limits and the 'message limit reached' notice.

Want to learn more? Take the free WordPress course, lesson 9.1 Email from WordPress.

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…