Home Forums Porto Template reCaptcha in contact form

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10031218
    surfersteve
    Participant

    Hi,

    I’ve attempted to add a google v2 Recaptcha to this website, but it doesn’t seem to be working as the Recaptcha is ignored.

    I’ve done the things stated in the ‘Google Recaptcha v2’ link within the HTML document that came with the theme and that didn’t work so I followed the instructions on this forum post that I found link

    Any help would be much appreciated.

    Thanks,

    Steve


    #10031220
    Support2
    Keymaster

    Hello Steve,

    The HTML structure and JS into your front-end it’s all correct.

    We need check your server side file php/contact-form.php. Please share all code of this with us. You can use a service like https://pastebin.com to generate a link with the code for us (change to “XXXX” where has credentials like password/secret keys)

    Kind Regards,

    Rodrigo.


    #10031222
    surfersteve
    Participant
    This reply has been marked as private.
    #10031225
    Support2
    Keymaster

    Hello Steve,

    The code in your contact-form.php also seems to be all correct.

    This is a strange issue, since the contact-form.php it’s returning success even with empty $_POST['recaptcha'].

    In that case we will need a temporary access to your server files trough FTP, can you please create a temporary access for us ? We will need host, username and password. In that way we can do some tests and discover where is the issue.

    Kind Regards,

    Rodrigo.


    #10031229
    surfersteve
    Participant
    This reply has been marked as private.
    #10031232
    Support2
    Keymaster
    This reply has been marked as private.
    #10031233
    surfersteve
    Participant
    This reply has been marked as private.
    #10031234
    Support2
    Keymaster

    Hello Steve,

    No problem! 🙂

    Regarding the new error: It’s missing the HTML code that shows the message errors from recaptcha:

    <div class="alert alert-danger d-none" id="contactError">
    	<strong>Error!</strong> There was an error sending your message.
    	<span class="mail-error-message text-1 d-block" id="mailErrorMessage"></span>
    </div>

    * I already added this HTML code to your index.html trough the FTP.

    Note that now returns Please click on the reCaptcha box when user try to send without check the recaptcha.

    When we check the recaptcha and try to send email it’s returning Could not instantiate mail() function. This means that your server don’t have the PHP mail() function enabled. In that case you need contact your hosting provider to enable this OR use SMTP to send emails. I suggest to your the SMTP method.

    To use the SMTP method just uncomment the “Step 2” on the contact-form.php file:

    // Step 2 (Optional) - If you don't receive the email, try to configure the parameters below:
    
    $mail->IsSMTP();                                         // Set mailer to use SMTP
    $mail->Host = 'mail.yourserver.com';                     // Specify main and backup server
    $mail->SMTPAuth = true;                                  // Enable SMTP authentication
    $mail->Username = 'user@example.com';                    // SMTP username
    $mail->Password = 'secret';                              // SMTP password
    $mail->SMTPSecure = 'tls';                               // Enable encryption, 'ssl' also accepted
    $mail->Port = 587;                                       // TCP port to connect to

    * Get the correct SMTP settings values with your hosting provider.

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10031242
    surfersteve
    Participant

    Hi Rodrigo,

    I setup SMTP and it’s now working perfectly.

    Thanks again for your help and once again sorry about the php/contact-form.php not being synchronised!

    Steve


    #10031247
    Support2
    Keymaster

    Hello Steve,

    Great!

    Don´t worrie about php/contact-form.php sync.

    Kind Regards,

    Rodrigo.


Viewing 10 posts - 1 through 10 (of 10 total)