PHP Formmail Script with SPAM Block

Everyone's EMail is clogged with SPAM these days, and for webmasters it's worse if you have a contact form on your site that keeps getting SPAMmed. Even more terrible is when your formmail script is hijacked by hackers to send SPAM to others with your Email server information shown as the source! That can cause SPAM filters around the web to block all EMail coming from your server, and it can take a long time to repair that situation. Obviously, this is a common problem for webmasters and website designers. This script is designed to be a drop-in solution for webmasters of all levels of experience who need to protect their mail forms from SPAM and hacking attacks. Yes, it supports file attachments as an option, too! The package you can download using the button below includes documentation for this script in the file "no-spam-readme.txt".


The PHP script included in this package (see 'confirm.php') is written to be very compatible with Matt's Formmail and other mail forms, so you probably only need to change the "action" attribute on your <for> tags to use it. It's also very flexible and easily modified to support your existing contact forms that use other scripts. It looks for some common methods that SPAMmers use to attack mail form scripts to either send SPAM to webmasters or to broadcast their SPAM messages using your website's mail server. You'll still need your existing SPAM filters for the most obvious attacks, but this PHP script checks for problems that are unique to mail forms - many of which never reach your computer. And every little bit helps keep your inbox cleaner. I also recommend that you use a CAPTCHA field in your mail forms. "Captcha" systems prevent automated systems (malicious scripts or bots) from filling in your forms. Google offers a good free script called reCaptcha that I've used with success. Check it out!

No SPAM PHP Formmail Features

  • 95% Compatible replacement for Matt's Formmail v1.92
  • Works with any other mail form, too.
  • Does not require your Email address to be included in the <form> code on your website.
  • Can be set to send only to a specific Email address regardless of <form> settings.
  • Can be used without modifying your existing contact forms.
  • Allows custom fields.
  • Blocks many SPAM messages that pass through normal SPAM filters.
  • Supports reCaptcha v2.0
  • Blocks many mail form hijacking methods.
  • Supports optional user file upload attachments.

No SPAM Formmail is a part of my SMTP_FormMail package and is provided free of charge. All I ask is that if you use this software, please place the following link in an appropriate location on your site:

<a href="https://www.rainbodesign.com/pub/">Rainbo Design's Scripts and Tools for Webmasters</a>


 Download No SPAM FormMail Package 



This page was last modified on August 27, 2020



Copyright © 2005-2024 by Richard L. Trethewey - Rainbo Design Minneapolis. It's not that I think this is such an earth-shatteringly great presentation, but if you want to copy it, I'd appreciate it if you would ask for permission. I've been working with computers for over 30 years now, and one phrase keeps popping into my head - "I hate it when it's right!" And laptops and smartphones are no better.

Looking for more website design information? See my Sitemap!