Body: <p>Platform:</p>
  <ul>
  <li>Craft Solo 3.7.21</li>
  <li>P&amp;T Contact Form plug in 2.2.7</li>
  <li>Redactor 2.8.8</li>
  </ul>
  <p>I am trying to use the Contact Form plugin and having problems when using the latest version of the API. I have an old implementation from several years ago that works, but when upgrading to the most recent plugin example code get an error when trying to submit a form.</p>
  <p>This works:</p>
  <pre><code> &lt;form method=&quot;post&quot; action=&quot;&quot; accept-charset=&quot;UTF-8&quot; class=&quot;form1&quot;&gt;
       {{ csrfInput() }}
                  &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;contact-form/send&quot;&gt;
                  {{ redirectInput('thanks?from={fromName}') }}
                  &lt;h2&gt;Please enter the following:&lt;/h2&gt;
                  &lt;div class=&quot;indicates-required&quot;&gt;&lt;span class=&quot;asterisk&quot;&gt;*&lt;/span&gt; indicates required&lt;/div&gt;    
                  &lt;div class=&quot;mc-field-group&quot;&gt;&lt;label for=&quot;from-name&quot;&gt;Your Name&lt;/label&gt;
                      &lt;input id=&quot;from-name&quot; type=&quot;text&quot; name=&quot;fromName&quot; value=&quot;{{ message.fromName ?? '' }}&quot;&gt;
                      {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
                  &lt;/div&gt;
                  &lt;div class=&quot;mc-field-group&quot;&gt;
                      &lt;label for=&quot;from-email&quot;&gt;Your Email &lt;span class=&quot;asterisk&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;input id=&quot;from-email&quot; type=&quot;email&quot; name=&quot;fromEmail&quot; value=&quot;{{ message.fromEmail ?? '' }}&quot;&gt;
                      {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
                  &lt;/div&gt;
                  &lt;div class=&quot;mc-field-group&quot;&gt;
                      &lt;label for=&quot;subject&quot;&gt;Subject&lt;/label&gt;
                      &lt;input id=&quot;subject&quot; type=&quot;text&quot; name=&quot;subject&quot; value=&quot;{{ message.subject ?? '' }}&quot;&gt;
                      {{ message is defined and message ? errorList(message.getErrors('subject')) }}
                  &lt;/div&gt;
                  &lt;div class=&quot;mc-field-group&quot;&gt;
                      &lt;label for=&quot;message&quot;&gt;Message &lt;span class=&quot;asterisk&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                      &lt;textarea rows=&quot;10&quot; cols=&quot;40&quot; id=&quot;message&quot; name=&quot;message&quot;&gt;{{ message.message ?? '' }}&lt;/textarea&gt;
                      {{ message is defined and message ? errorList(message.getErrors('message')) }}
                  &lt;/div&gt;
                  &lt;input id=&quot;date&quot; type=&quot;text&quot; name=&quot;date&quot;&gt;
                  &lt;div class=&quot;clear&quot;&gt;
                      &lt;input type=&quot;submit&quot; value=&quot;Send&quot; class=&quot;button&quot;&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  <p>This generates the following error message:</p>
  <ul>
  <li>&quot;There was a problem with your submission, please check the form and try again!&quot;</li>
  </ul>
  <pre><code>&lt;form method=&quot;post&quot; action=&quot;&quot; accept-charset=&quot;UTF-8&quot; class=&quot;form1&quot;&gt;
                  
                  {{ csrfInput() }}
                  {{ actionInput('contact-form/send') }}
                  {{ redirectInput('thanks?from={fromEmail}') }}
  
                  &lt;h2&gt;Please enter the following:&lt;/h2&gt;
  
                  &lt;div class=&quot;indicates-required&quot;&gt;&lt;span class=&quot;asterisk&quot;&gt;*&lt;/span&gt; indicates required&lt;/div&gt;    
                  
                  &lt;div class=&quot;mc-field-group&quot;&gt;
                      &lt;label for=&quot;from-email&quot;&gt;Your Email Address&lt;/Address&gt;&lt;span class=&quot;asterisk&quot;&gt;*&lt;/span&gt;&lt;/label&gt;
                      {{ input('email', 'fromEmail', message.fromEmail ?? '', {
                          id: 'from-email',
                          autocomplete: 'email',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('fromEmail')) }}
                  &lt;/div&gt;
  
                  &lt;div class=&quot;mc-field-group&quot;&gt;&lt;label for=&quot;first-name&quot;&gt;First Name&lt;/label&gt;
                      {{ input('text', 'firstName', message.firstName ?? '', {
                          id: 'first-name',
                          autocomplete: 'First Name',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('firstName')) }}
                  &lt;/div&gt;
  
                  &lt;div class=&quot;mc-field-group&quot;&gt;
                      &lt;label for=&quot;last-name&quot;&gt;Last Name&lt;/label&gt;
                      {{ input('text', 'lastName', message.lastName ?? '', {
                          id: 'last-name',
                          autocomplete: 'Last Name',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('lastName')) }}
                  &lt;/div&gt;
                  &lt;input id=&quot;date&quot; type=&quot;text&quot; name=&quot;date&quot;&gt;
                  &lt;div class=&quot;clear&quot;&gt;
                      &lt;button type=&quot;submit&quot;&gt;Subscribe&lt;/button&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
  </code></pre>
  <p>Maybe the problem is obvious, but I'm not seeing it, so help is appreciated.<br />
  Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-16T19:26:17.437Z
Comments.Text: My guess is it's an email settings problem (Settings->Email in the Craft control panel). Try checking the Craft `storage/logs` folder for the underlying error.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-16T19:50:17.290Z
Comments.Text: Thanks, but Email works - I can send test emails, and as I say, with the old code the form is correctly submitted and the email sent.
  WRT log files, there are a bunch of them; which would I be most interested in checking?
Comments.UserDisplayName: g. eagle
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-16T20:11:15.497Z
Comments.Text: Try comparing the rendered HTML of the two versions and see if there are any obvious errors or differences?
Comments.UserDisplayName: David Kennedy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-16T23:29:48.803Z
Comments.Text: I tested your second code example and it didn't work, as you said. However, that code isn't the example from the Contact Form plugin documentation. It's missing the error list macro and has some other changes.
  
  I was able to get the contact form code from the documentation to work just fine. I would go back to that example and test that it works and then make your changes, one thing at at a time.
Comments.UserDisplayName: CraftQuest
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-17T00:49:38.530Z
Comments.Text: CraftQuest - You're right; the base demo code works, mine doesn't. Will do as you as you suggest and go through it line by line. Thanks.
Comments.UserDisplayName: g. eagle
Tags: <craft3><plugin-contactform>
Title: Contact Form not sending email with most recent version of template
ThreadText: # Contact Form not sending email with most recent version of template
  
  (Asked by: username_0 on 2021-11-16)
  
  Platform:
  
  * Craft Solo 3.7.21
  * P&T Contact Form plug in 2.2.7
  * Redactor 2.8.8
  
  I am trying to use the Contact Form plugin and having problems when using the latest version of the API. I have an old implementation from several years ago that works, but when upgrading to the most recent plugin example code get an error when trying to submit a form.
  
  This works:
  
  ```
   <form method="post" action="" accept-charset="UTF-8" class="form1">
       {{ csrfInput() }}
                  <input type="hidden" name="action" value="contact-form/send">
                  {{ redirectInput('thanks?from={fromName}') }}
                  <h2>Please enter the following:</h2>
                  <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>    
                  <div class="mc-field-group"><label for="from-name">Your Name</label>
                      <input id="from-name" type="text" name="fromName" value="{{ message.fromName ?? '' }}">
                      {{ message is defined and message ? errorList(message.getErrors('fromName')) }}
                  </div>
                  <div class="mc-field-group">
                      <label for="from-email">Your Email <span class="asterisk">*</span></label>
                      <input id="from-email" type="email" name="fromEmail" value="{{ message.fromEmail ?? '' }}">
                      {{ message is defined and message ? errorList(message.getErrors('fromEmail')) }}
                  </div>
                  <div class="mc-field-group">
                      <label for="subject">Subject</label>
                      <input id="subject" type="text" name="subject" value="{{ message.subject ?? '' }}">
                      {{ message is defined and message ? errorList(message.getErrors('subject')) }}
                  </div>
                  <div class="mc-field-group">
                      <label for="message">Message <span class="asterisk">*</span></label>
                      <textarea rows="10" cols="40" id="message" name="message">{{ message.message ?? '' }}</textarea>
                      {{ message is defined and message ? errorList(message.getErrors('message')) }}
                  </div>
                  <input id="date" type="text" name="date">
                  <div class="clear">
                      <input type="submit" value="Send" class="button">
                  </div>
              </form>
  
  ```
  
  This generates the following error message:
  
  * "There was a problem with your submission, please check the form and try again!"
  
  ```
  <form method="post" action="" accept-charset="UTF-8" class="form1">
                  
                  {{ csrfInput() }}
                  {{ actionInput('contact-form/send') }}
                  {{ redirectInput('thanks?from={fromEmail}') }}
  
                  <h2>Please enter the following:</h2>
  
                  <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>    
                  
                  <div class="mc-field-group">
                      <label for="from-email">Your Email Address</Address><span class="asterisk">*</span></label>
                      {{ input('email', 'fromEmail', message.fromEmail ?? '', {
                          id: 'from-email',
                          autocomplete: 'email',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('fromEmail')) }}
                  </div>
  
                  <div class="mc-field-group"><label for="first-name">First Name</label>
                      {{ input('text', 'firstName', message.firstName ?? '', {
                          id: 'first-name',
                          autocomplete: 'First Name',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('firstName')) }}
                  </div>
  
                  <div class="mc-field-group">
                      <label for="last-name">Last Name</label>
                      {{ input('text', 'lastName', message.lastName ?? '', {
                          id: 'last-name',
                          autocomplete: 'Last Name',
                      }) }}
                      {{ message ? _self.errorList(message.getErrors('lastName')) }}
                  </div>
                  <input id="date" type="text" name="date">
                  <div class="clear">
                      <button type="submit">Subscribe</button>
                  </div>
              </form>
  
  ```
  
  Maybe the problem is obvious, but I'm not seeing it, so help is appreciated.  
  Thanks.
  
  **Tags:** craft3, plugin-contactform
  
  > **Comments:**
  > **username_1**: My guess is it's an email settings problem (Settings->Email in the Craft control panel). Try checking the Craft `storage/logs` folder for the underlying error.  
  > **username_0**: Thanks, but Email works - I can send test emails, and as I say, with the old code the form is correctly submitted and the email sent. WRT log files, there are a bunch of them; which would I be most interested in checking?  
  > **username_2**: Try comparing the rendered HTML of the two versions and see if there are any obvious errors or differences?  
  > **username_3**: I tested your second code example and it didn't work, as you said. However, that code isn't the example from the Contact Form plugin documentation. It's missing the error list macro and has some other changes.  I was able to get the contact form code from the documentation to work just fine. I would go back to that example and test that it works and then make your changes, one thing at at a time.  
  > **username_0**: username_3 - You're right; the base demo code works, mine doesn't. Will do as you as you suggest and go through it line by line. Thanks.  
  
  ---
  
  ## 0 answers
  
  