-
Notifications
You must be signed in to change notification settings - Fork 14
Troubleshooting
Here are some common issues and solutions that you might encounter the first time you try to get a contact form working in Moodle.
The sample code included in the documentation for the Contact Form for Moodle plugin assumes that you are submitting the form from a Moodle page. If you are submitting it from a different type of plugin like an HTML block, you may need to modify the URL in the ACTION parameter of the FORM tag so that it reflects the location of local/contact/index.php plugin. You can avoid this problem completely by using the {wwwroot} tag from the FilterCodes plugin if installed and activated. See an example on how to use the {wwwroot} tag with Contact Form.
When submitting a form, you get a blank screen, a message saying "Forbidden" or it just doesn't work.
Normally if there is anything wrong with your webform, you should see a message that says "Forbidden", not get a blank screen. Regardless, you can uncover the cause of the error by enabling Developer Debug mode in Moodle and then trying to send a message through your form again. This time you should see one or more messages appear that will tell you what's wrong with your webform.
To enable debugging, login to your site as a Moodle Administrator and navigate to Home > Site Administration > Development > Debugging. Next, set Debugging Messages to DEVELOPER: Extra Moodle debug messages for Developers and make sure the box next to "Display debug messages" is checked if you want to see the errors on your screen. Otherwise they just end up in your log file. Scroll down to the bottom of the page and click the Save changes button.
IMPORTANT NOTE: This will cause extra debugging messages to appear across your whole site for all users. If this is a live site, do this when no one is using the site. Either way, be sure to set Debugging Messages back to NONE as soon as you are done.
If there is a problem with your form, you should see some extra information which will either be helpful or that you can use to find an answer in the documentation. If not, go back to the Debugging page and check the box for Debug email sending and try again. Don't forget to go back and uncheck this box too.
In order for Contact Form to work properly, you must configure the no-reply email address with a valid email address.
In order for Contact Form to work properly, you must configure the support email address with a valid email address.
Contact Form does not support file attachments so don't even try.
The form must contain a submit button with an id/name of "submit" however the value of the button, which is the text that appears in the button can be anything you like.
Let's be reasonable. Do you think your users have all day to be out filling over 1024 fields in your form? By the way, 1024 includes hidden fields as well as the submit button.
Don't even think about changing it to a GET method. It's not going to work unless you can give me a really good reason why I should support the GET method as well as POST.
Are you asking users to submit their homework through a Contact Form? Take a look at the Assignment activity module. Best form design practices should limits the information you require just to the information you need and they don't need to send you over 256 KB of information in an email. Who are you trying to kid? You're not going to read it anyway.
You probably didn't include the SCRIPT tag line in the form or the hidden "sesskey" hidden field. These are some of the required HTML that is necessary in order for the form to work. Read the documentation and examine the code included in the Minimal Template Form Example. There are very specific elements that must be part of the form in order for it to work. As part of Moodle's anti-spam security.
There is an assumption going on here that people came from somewhere unlike a spambot that submits forms from nowhere. This is for your inbox protection.
We validate the "from" email address that you type into a form. Fill in the form honestly and we will let you submit it. The name of the form field email
is important and required... unless you are logged-in in which case it is optional. If you can't get it to work, try pasting in one of the HTML Form Template examples in a new Moodle page.
Yes, we validate the from name too. Fill in the form honestly and we will let you submit it. The name of the form field name
is important and required... unless you are logged-in in which case it is optional. If you can't get it to work, try pasting in one of the HTML Form Template examples in a new Moodle page.
This will show up if your email address was blacklisted. Either don't deny the email address or use a different email address. The feature has not yet been implemented at the plugin level at the time of this writing so, if you are seeing this error message, there might be something really messed up with your Moodle installation.
If your email address domain is unacceptable to the administrator, either because the domain of the email address has been blacklisted or because it is not included in the whitelisted domains. Either don't deny the domain or use an email address with an acceptable domain. If you are seeing this message, you have bigger problems because this feature has not yet been implemented.