Home » Php » php – How to prevent Contact Form 7 from sending emails

php – How to prevent Contact Form 7 from sending emails

Posted by: admin July 12, 2020 Leave a comment


I am using contact form 7 to generate forms and handle form submit.

I am also using Hubspot integration to capture form submission data and therefore, do not require any email to be sent from Contact Form 7.

Is there any way to disable the email attempting to be sent?

How to&Answers:

If you visit the contact form 7 website: https://contactform7.com/additional-settings/, you can see there is a call you can do in order to stop emails from being sent:

You can include additional settings to each contact form by adding
code snippets in the specific format into the Additional Settings
field in the contact form’s edit screen.

skip_mail: on

The skip_mail setting works in the almost same manner as the
demo_mode, but the skip_mail skips the mail sending only. Unlike
demo_mode, skip_mail doesn’t affect other activities like storing
messages with Flamingo.

Hope this helps.


demo_mode: on

If you set demo_mode: on in the Additional Settings field, the contact form will be in the demo mode. In this mode, the contact form will skip the process of sending mail and just display “completed successfully” as a response message.