Contact Form icon

Contact Form

Maintained by 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.
Price option: Free

Supports Moodle 3.0-5.2 See all versions
Latest release: 2 months ago
Installations: 4867
Downloads (last 90 days): 760

Frankenstyle name: local_contact
Local plugins

Comments

Comments are no longer open for new posts. Existing comments remain available to read.

Okay, I figured out what I left out in sendmail.php. Not sure why I saved the file like that, but it was obvious when I took a look. Seems to be working now. Thank you.
Ah, OK. Thank you for that very good explanation. Our messages go from the contact form to our support email address and are then picked up by our HelpDesk software (TeamDynamix). The tickets being created in TeamDynamix are using the FROM and not the REPLY TO to determine the ticket initiator. I will look at this further to see if I can figure out if there's anything I can do and then follow your suggests of posting in the forum and possibly a feature request. Thank you again. You are very responsive, and that's greatly appreciated.
Hi Blair, the reply to address is automatically populated with the senders email address. However you cannot see this unless you view the SMTP header. Another way to see it is to simply click reply to an email you receive. You will then notice that the return address is not the same as the From field. The reason for this is that most SMTP (i.e. email) servers do not allow emails to be sent from an email address that it does not recognize. This actually makes sense when you think about it because it is your website sending the email and not really the user. Anyway, this is why there is a from address and a reply-to address. If you want to discuss the further, please start a discussion on the discussion forum at https://moodle.org/mod/forum/discuss.php?d=352851 . If you think you have a valid valid case for a dynamic "from" field, please submit your feature request at https://github.com/michael-milette/moodle-local_contact/issues/ . I don't think it would be much work to develop a solution but I would want to make sure that it is going to actually work for you before I invest my time. Like I said, most mail servers would reject this.
Best regards,
Michael
I know I'm probably just blind, but I cannot figure out how to get the 'reply to' address to be that of the person filling in the form. I can see how to make it Moodle's noreply address, or to override that to something else for all messages, but not how to make it dynamic and show the user. I thought maybe putting the filtercode {email} into the 'custom sender' field would help, but it just defaulted to the noreply address.
Hi cyber sec. I can only try to help you here if you use the FilterCodes plugin as it was designed to be used. In order to help you with your sesskey error, see https://github.com/michael-milette/moodle-local_contact/blob/master/README.md#sesskey-error
If you are committed to making your code work, I suggest you ask your question in the developers forum. I will give you a hint though - you've stripped out too much code when making your sendmail.php.
I have the contact form plugin installed. The index.php file, and so on, are in the ../public_html/local/contact/ directory. I stripped down the code, a little, in those particular files, because I kept getting a sesskey error.
But, as you can see, there is nothing wrong with the html code, or php code. I have tried these outside of moodle, and they work.
Hi cyber sec, I'm not sure what any of what you posted has to do with the contact plugin. If you are trying to create your own code, I would suggest asking your question in the Moodle General Developer forum.
Cannot get this work again, and I cannot understand why. Any help trouble-shooting would be appreciated.
My webhost crashed my site. They had some huge hardware issue. Fortunately, I saved my content, including my contactus.html file, and my sendmail.php file.
I am using Moodle 3.7.7. That is the most recent version my hosting company allows. I am not using SSL or TLS for my email.
I put the contactus.html in a static page, and the sendmail.php in the ../public_html/local/contact/ directory. This is the same way I had setup before.
I set up outgoing email in moodle, and tested it, it works fine.
But the contact form will not send emails. I am not sure how to trouble-shoot this.
I stripped down the contactus.html form because I kept getting sesskey errors. This was working fine:
-------------
 <form action="../../local/contact/sendmail.php" method="post">
<label for="email" id="emaillabel">Email address <strong class="required">(required)</strong></label><br>
<input id="email" name="email" type="email" size="57" maxlength="60" required="required" value=""><br><br>
<label for="subject" id="subjectlabel">Subject <strong class="required">(required)</strong></label><br>
<input id="subject" name="subject" type="text" size="57" maxlength="80" minlength="5"
title="Minimum 5 characters." required="required"><br><br>
<label for="message" id="messagelabel">Message <strong class="required">(required)</strong></label><br>
<textarea id="message" name="message" rows="5" cols="58" minlength="5"
title="Minimum 5 characters." required="required"></textarea><br>
<input value="Submit" type="submit">
</form>

---------------
Here is the sendmail.php
-----------------
<?php
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
mail($email ,$subject, $message);
?>
Hi Ekkaggata Technologies. It is indeed compatible with Moodle 3.9 and will be indicated as such shortly. I am not sure what text box field you are expecting to see. This is a form processor, not a form builder. Please read the documentation on how to create a form and then ask any questions you might have in the discussion forum. Links to both of these are included in the Useful Links section of the Contact Form plugin page.
Best regards,
Michael
Hi cyber sec, I highly doubt it is a bug. This plugin is used on almost 2000 sites around the world. If sesskey was actually an issue, it would affect everyone. Please see my comment from September 15, 2020.
Hi - Will it work with Moodle 3.9? I installed but i cant see the text box field to type anything.
I am still having sesskey issues. I am fairly sure the /local/contact/index.php file is being found. The problem is not with the "form action" line. This might be a bug.
The answer to the sesskey question is included in the documentation. See:
https://github.com/michael-milette/moodle-local_contact/blob/master/README.md
For additional help, please submit your questions to:
Discussion forums: https://moodle.org/mod/forum/discuss.php?d=352851
To report a bug, please submit your support request to:
Issue tracker: https://github.com/michael-milette/moodle-local_contact/issues/
For faster paid support, please contact me through my website at:
http://www.tngconsulting.ca/
Best regards,
Michael
Keep getting this error: Forbidden. "sesskey" field is missing or contains an incorrect value.
I would like to show a link, not the entire form, on the front page. I tried saving the html "contract us" form as a static page, but that did not work. I could link to the page, but it would not accept input.