Hi @zebomfim,
I’ve manage to set up a fully functioning local copy of the website and after quite a bit of time, I’ve manage to track down the source of the problem. There are actually two issues to fix, both of which are the way in which this site has been configured.
First up, in functions.php
, there is a function called register_forms()
which is being hooked to the af/register_forms
hook. This should be deactivated as it’s settings are interfering with the form’s admin panel settings and breaking the form headers. If you wish to use PHP defined forms, it would be wise to update the PHP every time the form is modified in the database. My suggestion to you is to just rely on forms in the database.
Second, in the form’s email From field, please remove the quotes either side of the setting there. The quotes are causing PHPMailer to invalidate the from address and this is preventing emails from sending.
One other suggestion I have is that you avoid sending emails from the email address submitted with the form and instead use a ‘Reply-To’ header. There is a snippet which demonstrates how to do so here. The reason I suggest this is because some emails may end up being rejected based on the SPF setting on the senders domain. It’s much more reliable to use the websites admin address (or an address with the website domain) and rely on the Reply-To header.