Ok two things-
First, when you request support for a certain snippet, could you please make that request in that snippets support forum? That's what it's there for and it will give the future users of the snippet ONE place to go to look for other users issues. This will hopefully help resolve issues in a more timely manner.
@deanstev- can we please move this to
the EmailLink and EmailLinkForm support forum?
Ok, now to answer the question. The email form, by default, has this configuration for allowed email addresses:
// $emailDomains [ string ]
// An array of allowed email domains (what comes after the @ sign).
// Leave empty if you want to allow it to go anywhere
//$emailDomains = array(); // Use this line only if you want to allow all
$emailDomains[] = 'yourdomain.com';
$emailDomains[] = 'yourOtherDomain.com';
So basically, it will
not work in the default setup (unless you happen to be sending email to "yourdomain.com" or "yourOtherDomain.com"... which seems unlikely). This is intentional as this is a more secure option than allowing everything, which is another alternative.
So what you need to do is decide what email addresses you want to ALLOW this form to send to. If you don't care where it goes (not recommended) you can do this:
// $emailDomains [ string ]
// An array of allowed email domains (what comes after the @ sign).
// Leave empty if you want to allow it to go anywhere
$emailDomains = array(); // Use this line only if you want to allow all
That is, remove the "dummy" domains and set the array to empty. This will allow the mail to be sent anywhere.
A better idea, is to figure out which domains your common emails are sent to. Say I work for ACME and I know I'll need email sent to a bunch of people in the home office, who have emails like
username@acmecorp.com AND the non-profit sector too:
username@acmegiving.org. Then I would set the configuration like so:
// $emailDomains [ string ]
// An array of allowed email domains (what comes after the @ sign).
// Leave empty if you want to allow it to go anywhere
//$emailDomains = array(); // Use this line only if you want to allow all
$emailDomains[] = 'acmecorp.com';
$emailDomains[] = 'acmegiving.org';
You might want to send email to only one domain, say acmegiving.org, then you would delete the line that allows acmecorp.com.
This discussion would not be complete without emphasizing that this form ONLY works when used with the EmailLink snippet as well. EmailLink is responsible for generating a link to the form in such a way that the form will accept the address - all while hiding the address from spam-bots. So you
must use EmailLink to get to the form. Otherwise, the form will give you the error you show above.
Those are the two most common reasons your form would fail: improper config, or not using the EmailLink snippet.