General plugins (Local): Contact Form

Maintained by Picture of Michael Milette Michael Milette
Contact Form is a Moodle plugin that allows your site to process and send information submitted through HTML web forms to the site's support email address or primary administrator if the support email address is not defined.
253 sites
16 fans

The Contact Form plugin for Moodle processes information submitted through a custom web form, sending it by email to the site's support email address, if defined, or to the primary system administrator.

Examples uses for this plugin include:

  • Contact us form.
  • Support request form.
  • Request a course form.
  • Information request form.
  • Lead generation form.
  • Membership application form.
Share with us how you use this plugin on your site.

Note: This is not a web form builder but a form processor. You must have some knowledge of how to create HTML forms or at the very least be able to cut and paste the example included in the README file.

The initial work for this project was sponsored by the kind folk at l'Action ontarienne contre la violence aux femmes and TNG Consulting Inc..

Potential privacy issues

Reminder: Email message protocols may cross the Internet and store messages on mail servers in unencrypted plain text. If you are sending messages outside of your local area network, it is highly recommended that you do not use this plugin to collect sensitive information such as social insurance or credit card numbers. It has nothing to do with this plugin's functionality but just with the way email protocols work. This plugin on its own does not store any information - anywhere.


Screenshot #0
Screenshot #1
Screenshot #2


Picture of Michael Milette
Michael Milette (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Michael Milette
    Wed, 18 Oct 2017, 4:55 AM
    Hi LeeJH,

    I was not aware that it wasn't supporting UTF-8. I would like to work with you to better understand the issue to see if this can be resolved. For example, are you having trouble using Moodle string translation tool or that Contact Form can't send the email messages containing UTF8 text?

    Could you please use the Bug Tracker link on the Contact Form plugin page to open a new issue?

    Best regards,

  • Picture of Georg Wiesinger
    Wed, 18 Oct 2017, 7:42 PM
    Hi Michael,

    I would like to ask if there is any update on the road with support for form-specific custom autoresponders and the like? This would be really terrific! smile

    Kind regrads,
  • Picture of Michael Milette
    Tue, 24 Oct 2017, 10:58 PM
    Hi Georg, I am hoping to get the global autoresponder implemented in time for the upcoming release of Contact Form for Moodle in November/December 2017 however I am not sure that the "form specific" autoresponder will make it in on time. Keep an eye out on the the project's "dev" branch on GitHub to see the latest changes. If you want make sure you are personally notified when that feature does come out, add a "Feature Request" in the bug tracker. I will be sure to let you know when it becomes available. As always, if you want it sooner, I am available for hire wink

    Best regards,

  • Picture of S I
    Fri, 27 Oct 2017, 5:48 PM
    Dear Michael Milette,
    thank you for this plugin, it is very useful. We are kindly asking for your support/help with a recent error, though.

    We have been using the local contact form plugin without any trouble for a while on our German client's moodle site.
    Strangely, somewhere after the latest two moodle updates, the contact form stopped working.

    The error message says: Forbidden. Unknown sender - invalid email address or the form field name is incorrect

    We read your troubleshooting page on git hub. But sadly, the description of this error is not very helpful to us.
    The e-mail is valid and we did not change the form field names. We double checked all plugin files comparing them to backups to see if anything changed- nothing.

    Everything else on the moodle site concerning e-mails works fine, still, it is just local contact form which seems to have a problem. We installed email test and it records no errors. We tried Debugging, but could not locate the issue.
    We use the standard php method in email settings of moodle. We briefly changed that on the moodle site to using smtp server settings to see if that helps and the email tests still work fine...but the contact form still produces the same error message Forbidden. Unknown sender - invalid email address or the form field name is incorrect

    What changed or what are we doing wrong? If you or anybody else on here has any ideas what we could try or tips for us, we'd greatly appreciate it.
    Thank you for your time.

    Best regards,
  • Picture of Michael Milette
    Mon, 30 Oct 2017, 11:39 AM
    Hi Sue,

    Thank you for reporting this issue. I believe I might know the reason and have just published a new version of Contact Form for Moodle which should address your problem. However, you will need to make a few changes. The Name field must be called "name", Email field must be called "email". For consistency, the Subject field should be called "subject" and Message field called "message". The labels displayed in the email will still be taken from the language pack so these should display correct in German.

    What I suspect might have been happening is that someone updated the German translation in AMOS for the email fields. This affects anyone who was using the German language pack. Anyway, stick with the English names for these 4 fields and it should work again. By field name, I am referring to the input name="email" part of your form.

    Let me know if this resolves your problem. If it doesn't, please open an issue in the Bug Tracker (see link on the Contact Form plugin page) and I will be happy to work with you to resolve the issue.

    Best regards,

  • Picture of Tariq Majeed
    Mon, 30 Oct 2017, 10:47 PM
    Need help.. getting this error after implementing the code and testing the form:

    Forbidden. Unknown sender - invalid email address or the form field name is incorrect.
  • Picture of Michael Milette
    Mon, 30 Oct 2017, 11:49 PM
    Hi Tariq, thank you for taking the time to ask your question.

    First, please ensure that you are using the latest version of Contact Form for Moodle. It was just updated yesterday.

    Next, take a look at the troubleshooting section of the Wiki for contact form. There is a section that addresses this very issue:

    Finally, if you are still having trouble, please open a ticket in the Bug Tracker. Be sure to include the HTML for your form. It formats best in the editor if your all of your HTML source code is indented by 4 spaces.

    Hope this helps.

    Best regards,

  • Picture of S I
    Wed, 1 Nov 2017, 9:01 PM
    Hello again Michael!

    First, my colleague Katja and me would like to thank you very much for your swift reply and support, we spent hours trying to figure out what's wrong and your explanation solved the problem within minutes. smile
    For your information, after we received your message, we did the following:

    - update the plugin with the brand new version you provided

    - changed the class name in the action of the form, which was apparently the only difference in the plugin form compared to our old version:
    to now: works again, hurray. ;)

    PS, in case this info is important:
    We checked again and the mandatory form fields were and are still in English language (name, email, subject, message …), but my colleague found that it might have indeed been a problem with us only using the German language pack. We also have additional form fields which still work fine as well now, just in case that's helpful info to anyone.

    What we cannot say for sure is when exactly the plugin stopped working, it might have been one or two moodle updates ago.

    So, if any other German moodle site users run into this problem, your helpful comment and update did the trick for us.
    Thank you again and have a great day!

    Best regards, Sue
  • Picture of Michael Milette
    Sun, 5 Nov 2017, 4:36 PM
    Thank you for your feedback Sue!

    Glad to hear that it is now working for you. I truly believe the bugs fixed included in the update did the trick. The class name is simply there so that you can style your form using CSS. You could actually call it using any valid class name or leave the class name out completely.

    Upgrading to this latest version is actually recommended for anyone using non-English language packs, not just German.

    Best regards,

  • Picture of Michael Milette
    Sat, 11 Nov 2017, 3:35 PM
    Great news! The latest release if Contact Form for Moodle is now available on Besides being compatible with Moodle 3.0 to 3.4, ReCAPTCHA is now also supported for users who are either not logged-in or logged-in as guest. Users who are logged-in as regular users will not see the ReCAPTCHA. To make it work, you will need to also install the FilterCodes plugin in order to add a {recaptcha} tag into your form. See the documentation for more information.


    Michael Milette
  • Picture of Georg Wiesinger
    Mon, 13 Nov 2017, 10:02 PM
    Hi Michael,

    many thanks for supporting reCaptcha in combination with your FilterCodes plugin, it's really awesome! I already tested it and it basically works like a charm! There is only one thing I noticed: The reCaptcha code generated by the FilterCode plugin is using http prefix, so on fully encrypted Moodle instances the reCaptcha won't appear as it will be blocked by browsers due to security reasons.

    Kind regards,
  • Picture of Michael Milette
    Mon, 13 Nov 2017, 11:45 PM
    Hi George,

    You are most welcome. I am always grateful to hear when find my work useful.

    Thank you for bringing the https issue with the ReCAPTCHA to my attention. This functionality is actually part of the FilterCodes plugin. I have corrected the issue and uploaded a an updated version to You'll need to update the FilterCodes plugin. No change is required of the Contact Form for Moodle plugin.

    Feel free to let me know if it gives you anymore grief. It is feedback like yours that makes me a better developer. smile

    Kind regards,
  • Picture of Georg Wiesinger
    Tue, 14 Nov 2017, 6:21 AM
    Hi Michael,

    it still doesn't work for me, tested with Safari, Chrome, Firefox and Opera Browser! reCAPTCHA is still loaded via http.

    Kind regards,
  • Picture of Michael Milette
    Tue, 14 Nov 2017, 10:32 AM
    Sorry for the inconvenience George, my bad. Forgot to actually return the https status in one of my functions. I really do appreciate your sticking with it though as it should be all fixed up now. Please upgrade to the latest FilterCodes. --Michael
  • Picture of Georg Wiesinger
    Tue, 14 Nov 2017, 3:54 PM
    Good morning Michael,

    no problem at all! Everything is working flawlessly right now! smile Many thanks for all your effort!

    Kind regards,
1 2 3
Please login to post comments