`Forbidden. "sesskey" field is missing or contains an incorrect value.`

`Forbidden. "sesskey" field is missing or contains an incorrect value.`

by cyber sec -
Number of replies: 2

Moodle 3.7.

I get this error with the "Contact Form" pluggin. I get it every time.

User self registration works, at least sometimes, so Moodle can send mail.

I think my site is using "Let's encrypt" for SSL/TLS. I know it's some kind of free https.

My site is hosted by hostwinds.com.

My SMTP setup in Moodle is not set to use SSL or TLS. Neither of those work.

Oddly, email works when sending mail to yahoo.com, or my website on hostwinds. But it seems to have trouble with gmail, or google apps mail. I can find no reason for this, I would think the problem is with google, but I get no help from google support.


Average of ratings: -
In reply to cyber sec

Re: `Forbidden. "sesskey" field is missing or contains an incorrect value.`

by Leyla Aliyeva -

Having the same issue! Any luck? 

In reply to Leyla Aliyeva

Re: `Forbidden. "sesskey" field is missing or contains an incorrect value.`

by cyber sec -

I figured out a work-around.

For the “contactus.html” form just use this:

<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>

Then, in the same directory that has the /local/contact/index.php file. Create another file called “sendmail.php” and put this in that file:

<?php 
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];
mail($email ,$subject, $message);
?>  

Super simple, and it works. But, I don't think it hides your email address from the person you send the email to. If I figure that out, I will post it here.