You can skip mail using:
add_filter( 'wpcf7_skip_mail', '__return_true' );
Since you disabled javascript with
add_filter( 'wpcf7_load_js', '__return_false' );
then you can use:
add_filter( 'wpcf7_form_response_output', 'wpse_form_response_output', 10, 4 );
in your wpcf7_before_send_mail action wpcf7_before_send_mail , where is your custom error response:
function wpse_form_response_output( $output, $class, $content, $object ) { return sprintf( '<div class="wpcf7-response-output wpcf7-display-none wpcf7-mail-sent-ng" role="alert" style="display: block;">%s</div>', __( 'SOAP ERROR - Mail not sent!' ) ); }
source share