• Hello,
    I’ve been installing new web servers, and moving our clients sites across from old web servers (All Plesk, all Ubuntu), I have noticed however that all contact form 7 installations on the move sites will not send. To clarify these are duplicate installs of the sites. Installing Ninja forms works 100% however contact form 7 will not work. Furthermore all of these sites are using sendgrid via WP Mail SMTP however converting these sites to Ninja forms is a lengthy process?

    The error message for all of the moved sites using Cf7 is the yellow bordered, “Failed to send your message. Please try later or contact the administrator by another method.”

    Can anyone provide any suggestions as to why this may be occurring?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I see same issue and message:
    “Failed to send your message. Please try later or contact the administrator by another method.”

    PHP: 7.3.3
    cURL Host: x86_64-redhat-linux-gnu
    cURL SSL Version: OpenSSL/1.0.2r
    cURL libz Version: 1.2.7

    {
    “into”: “#wpcf7-f1525-o2”,
    “status”: “spam”,
    “message”: “Failed to send your message. Please try later or contact the administrator by another method.”
    }

    • This reply was modified 5 years, 7 months ago by parvez2. Reason: added additional log

    One issue that has been preventing CF7 mail from being sent on our systems is related to the CF7 POST URL lacking a trailing slash:

    
    POST https://<domain>/wp-json/contact-form-7/v1/contact-forms/196/feedback
    301  Moved permanently > https://<domain>/wp-json/contact-form-7/v1/contact-forms/196/feedback/
    404  Not found https://<domain>/wp-json/contact-form-7/v1/contact-forms/196/feedback/
    

    Trailing slashes are automatically added on our systems so this causes a problem. It would be nice if CF7 could add a trailing slash to their POST URL’s so that the URL structure is consistent throughout WordPress.

    One other tip: we are also using Sendgrid to send email, on our systems the official Sendgrid WordPress plugin seems to work better than WP Mail SMTP.

    Thread Starter Nate1

    (@nate1)

    The issue is that I’ve removed the user agent using varnish, however it doesn’t alert to the problem which is a little frustrating.

    `switch ( $submission->get_status() ) {
    case ‘validation_failed’:
    ….
    case ‘spam’:
    $class .= ‘ wpcf7-spam-blocked’;
    break;`

    Tracking that down, If theres no user agent the mail gets marked as spam. Standardized requests in varnish means this isn’t very desirable – is it possible this could be configurable?

    private function spam() {
    		$spam = false;
    
    		....
    
    		$user_agent = (string) $this->get_meta( 'user_agent' );
    
    		if ( strlen( $user_agent ) < 2 ) {
    			$spam = true;
    		}
    
    		if ( ! $this->verify_nonce() ) {
    			$spam = true;
    		}
    
    		if ( $this->is_blacklisted() ) {
    			$spam = true;
    		}
    
    		return apply_filters( 'wpcf7_spam', $spam );
    	}

    As a workaround, instead of just
    unset req.http.User-Agent;

    I’ve added
    set req.http.User-Agent = "x-varnish";
    Which allows it to sidestep the spam validation whilst standardizing all requests.
    The varnish installs are the latest versions, and though plesk etc was the same on the old server the varnish was vcl3.0 and didn’t have a clause set for the user agent.

    • This reply was modified 5 years, 7 months ago by Nate1.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘CF7 Not sending’ is closed to new replies.