The Divi Theme's contact form module offers several features to help reduce the volume of spam comments you receive. This include a math-based captcha, and support for Google's ReCaptcha v3.
Despite these, you may still find some spam emails getting through. Another option, which complements these, is to ban particular email addresses or domains from being submitted as the user email.
Examples uses for this are:
1. Ban the specific email addresses of persistent spammers
2. Ban email addresses from a free email provider from which you are seeing lots of spam, and no legitimate emails
3. Ban email addresses from your own domain – useful if you don't send yourself contact form messages and are seeing spammers fake email addresses from your own domain.
4. Ban the use of particular words in email addresses (e.g. "viagra")
Blacklisting Emails using Divi Booster
Divi Booster adds an option to the Divi contact form to allow easy blacklisting of email addresses.
With Divi Booster enabled, you'll see a new option in the contact form settings at:
Contact Form Settings > Content > Spam Protection > Use Email Blacklist
Enable this field to activate the email blacklisting feature
With the email blacklist activated, you'll see a new field for entering the email addresses or domains to blacklist:
Contact Form Settings > Content > Spam Protection > Email Blacklist
The example above shows an email blacklist with with two items. The first line blocks all emails from a particular domain. The second line blocks a specific email address. The third line blocks a particular keyword; if it matches any part of the email address entered by the user, the email address will be blocked.
This feature is available as of Divi Booster 3.1.4.
Configuring the Error Message
By default, When the contact form is submitted with a blacklisted email address, the user will receive an "Invalid Email" message, like so.
You can customize this error message by entering a custom text at:
Divi Booster > Contact Form > Spam Protection > Email Blacklisted Message
Which should display on the front end like so:
The option to set a custom error message was added in Divi Booster v4.0.8.



Question: how do you stop spam emails using gmail?
Like "a.e.spammystring@gmail.com"
Hey D, if the "spammystring" is always the same – i.e. you're repeatedly getting hit by the same address – then you could add "spammystring@gmail.com" to the email blacklist to block it. But assuming the spammy string is more or less random then there's probably not much you can do with the email blacklist. In that case you'd need to use other spam protection such enabling recaptcha and/or passing the resulting messages through a spam filter.
The email blacklist is mainly useful for blocking domains that you'd not normally get legitimate mail from (e.g. if you run a local business you may want to block foreign free mail providers), or particular persistent spam email addresses. I'm assuming that you get legitimate contacts from gmail, but obviously if you didn't you could entirely block gmail.com – I'm just not sure there are many businesses in the Western world where that would be true…