I thought I would share my experience here with others. I am evolving my own website and also create websites for others. I like to have a contact form and have endured SPAM in the past. I really liked the new Version 2 of Google's reCAPTCHA, so tried to integrate that. I also have preference for a form that is handled by my own web sever -- not one that is outsourced to a 3rd party like Jotform or another. Controlling everything on your own server seems like it gives you a lot more control. I am still working out a few bugs.

My experience in the past was with the old "BNBForm" code, which was in Perl. I decided to try TFMail package which is also in Perl. I like a scripting language so one can modify the results. I am not a Perl programmer but know how to teach myself with some old experience in many other languages.

Accomplishments:
==============

(1) Got TFMail going on my own form. I coded a form by hand in HTML. Using a generator and modifying it would be just as good... or better.

It is fairly powerful and flexible, once all the peculiarities are worked out with your server.

(2) Got Google reCAPTCHA working on the form in a placeholder in Xara and using very simple server-side Perl programming.

There is almost no documentation on the Version 2 reCAPTCHA for Perl. I had to scrounge all over the web and teach myself a little Perl. There is a Captcha::reCAPTCHA:V2 library out there (V2.pm) but it didn't work for me and it is way more than I needed since I was handling the form in HTML as Google seems to suggest is easiest.

(3) I modified TFmail to handle capturing an error from no reCAPTCHA on a submitted form.

This uses a new template in TFmail to explain to the user that they should push the back button and do it again.

I would be happy to share my code changes with anyone if they want to do this.


Issues Remaining:
=============

(1) I have not yet gotten TFmail to send a confirmation notice to the user if they entered their email address. Not sure why yet. TFmail authors were adamant that this should not be done because it would allow others to SPAM people via your email server. I think this almost goes away with reCAPTCHA, but I think the authors may be causing this issue with too much caution. Need to learn more Perl or get help from one of you.

(2) Two Xara variants are not displaying the reCAPTCHA box on the form.

I am not sure why this is. The first website I am trying this on has three variants. I have HTML/Javascript statement for the code in the head of the placeholder. I also have the form showing in all variants via placeholder body code. The reCAPTCHA shows and works on the main variant, but does not show on the other two variants -- although the form and submit button show on those two variants.

I speculated that Google would only serve one, but when I reload in the errant variants, the reCAPTCHA does not show there -- only on the main. I read this forum in a few places and it seems that <iframe> export on Jotforms solved this similar problem on other sites. I have since forgotten what <iframe> is, but will look it up and give it a try.

If anyone has solutions to the above two issues or wants to see the whole Perl code for the reCAPTCHA v2, let me know here.