<p>welcome to the CraftCMS StackExchange </p>
<p>I dug around on the <code>craftcms/contact-form</code> repo and <a href="https://github.com/craftcms/contact-form/issues/228" rel="nofollow noreferrer">found an open issue</a> for the same error you're describing.</p>
<p>Basically, (as things currently stand) you need to add a field to your form with the name <code>fromName</code> for it to successfully submit. With the upgrade to Craft 4 it seems that <code>fromName</code> joined <code>fromEmail</code> and <code>message</code> as required fields, though that wasn't documented properly.</p>
<p>You could either change up your &quot;First Name&quot; field a bit like so:</p>
<pre><code>&lt;input id=&quot;from-firstname&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;fromName&quot; value=&quot;&quot; required&gt;
</code></pre>
<p>Or if you're using some JS on the frontend, you could add a hidden input field:</p>
<pre><code>&lt;input id=&quot;full-name&quot; type=&quot;hidden&quot; name=&quot;fromName&quot; value=&quot;&quot; /&gt;
</code></pre>
<p>...and then when your form's submit button is clicked, you could fetch the values of the <code>yourFirstName</code> and <code>yourLastName</code> field and join them and update the value of this hidden field, and then let the form submission proceed as normal. That might be a bit of a complex solution though depending on your familiarity with JS...</p>

CC BY-SA 4.0
2022-11-13T12:44:43.897Z
Thank you for your answer!! Yes, i found out the same. So with Craft 3 it was working. But in Craft 4 those fields are required for the submit :)
Marcel Boer
CC BY-SA 4.0
2022-11-12T20:48:26.960Z
2022-11-15T03:33:09.067Z
2022-11-15T03:33:09.067Z
Jalen Davenport
<p>After upgrading to Craft 4 non of my Craft Forms are working... getting the error &quot;Symfony\Component\Mime\Address::__construct(): Argument #2 ($name) must be of type string, null given, called in /html/JANS-Staging/vendor/yiisoft/yii2-symfonymailer/src/Message.php on line 368&quot; ... any idea please? </p>
<p>Also: For me the example code from here <a href="https://github.com/craftcms/contact-form/" rel="nofollow noreferrer">https://github.com/craftcms/contact-form/</a> is working on a fresh installed Craft 4 version, but not on an upgraded one from 3 to 4...  not receiving any mail.</p>
<p>This is my form code:</p>
<pre><code>&lt;form method=&quot;post&quot; action=&quot;&quot; enctype=&quot;multipart/form-data&quot; accept-charset=&quot;UTF-8&quot; class=&quot;form&quot; id=&quot;form-jans-contact&quot; autocomplete=&quot;off&quot;&gt;
      {{ csrfInput() }}
      &lt;input id=&quot;Gr3tHousesComeToLIf3&quot; name=&quot;Gr3tHousesComeToLIf3&quot; type=&quot;text&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;toEmail&quot; value=&quot;{{'marcelboer@me.com'|hash}}&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;subject&quot; value=&quot;{{&quot;career.application&quot;|translate}} - {{entry.title}}&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;contact-form/send&quot;&gt;
      {{ redirectInput(craft.entries.section('brochureConfirm').one.url) }}
      &lt;div class=&quot;form-wrapper form-full&quot;&gt;
        &lt;div class=&quot;form-aside__left&quot;&gt;
          &lt;div class=&quot;form-tiles&quot;&gt;
            &lt;div class=&quot;form-tile&quot;&gt;
              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-firstname&quot;&gt;{{&quot;form.yourFirstName&quot;|translate}}*&lt;/label&gt;
                    &lt;input id=&quot;from-firstname&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.yourFirstName&quot;|translate}}]&quot; value=&quot;&quot; required&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-lastname&quot;&gt;{{&quot;form.yourLastName&quot;|translate}}*&lt;/label&gt;
                    &lt;input id=&quot;from-lastname&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.yourLastName&quot;|translate}}]&quot; value=&quot;&quot; required&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-email&quot;&gt;{{&quot;form.emailaddress&quot;|translate}}*&lt;/label&gt;
                    &lt;input id=&quot;from-email&quot; class=&quot;form-input&quot; type=&quot;email&quot; name=&quot;fromEmail&quot; value=&quot;{{ message.fromEmail ?? '' }}&quot; required&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-phone&quot;&gt;{{&quot;form.phone&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-phone&quot; class=&quot;form-input&quot; type=&quot;tel&quot; name=&quot;message[Telefon]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label form-label-files&quot; for=&quot;from-files&quot;&gt;{{&quot;career.uploadFiles&quot;|translate}}:&lt;/label&gt;
                    &lt;input class=&quot;form-input form-files&quot; type=&quot;file&quot; name=&quot;attachment[]&quot; id=&quot;from-files&quot; multiple&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-tile&quot;&gt;
              &lt;h4 class=&quot;form-tile__title&quot;&gt;{{&quot;form.yourAddress&quot;|translate}} (Optional)&lt;/h4&gt;
              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-7&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-street&quot;&gt;{{&quot;form.street&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-street&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.street&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;form-row f-row-3&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-housenumber&quot;&gt;{{&quot;form.number&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-housenumber&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.number&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-zipcode&quot;&gt;{{&quot;form.zipcode&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-zipcode&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.zipcode&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-city&quot;&gt;{{&quot;form.city&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-city&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.city&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;

              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-country&quot;&gt;{{&quot;form.Country&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-country&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.Country&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
                &lt;div class=&quot;form-row f-row-5&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;from-comment&quot;&gt;{{&quot;form.comment&quot;|translate}}&lt;/label&gt;
                    &lt;input id=&quot;from-comment&quot; class=&quot;form-input&quot; type=&quot;text&quot; name=&quot;message[{{&quot;form.comment&quot;|translate}}]&quot; value=&quot;&quot;&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;div class=&quot;form-tile&quot;&gt;
              &lt;h4 class=&quot;form-tile__title&quot;&gt;{{&quot;form.moreComments&quot;|translate}}&lt;/h4&gt;
              &lt;div class=&quot;form-column&quot;&gt;
                &lt;div class=&quot;form-row f-row-10&quot;&gt;
                  &lt;div class=&quot;form-group&quot;&gt;
                    &lt;label class=&quot;form-label&quot; for=&quot;message&quot;&gt;{{&quot;form.comment&quot;|translate}}&lt;/label&gt;
                    &lt;textarea rows=&quot;10&quot; cols=&quot;40&quot; id=&quot;message&quot; class=&quot;form-input form-textarea&quot; name=&quot;message[body]&quot;&gt;{{ message.message ?? '' }}&lt;/textarea&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;

      &lt;div class=&quot;form-submit&quot;&gt;
        &lt;div class=&quot;form-end&quot;&gt;
          &lt;ul class=&quot;form-checkbox__list&quot;&gt;
            &lt;li class=&quot;form-checkbox _smaller-text&quot;&gt;
              &lt;input id=&quot;f-cb14&quot; class=&quot;form-checkbox__input&quot; name=&quot;message[{{&quot;form.consent&quot;|translate}}][]&quot; type=&quot;checkbox&quot; value=&quot;{{&quot;form.consent.dataprivacy&quot;|translate}}&quot; required&gt;&lt;label for=&quot;f-cb14&quot;&gt;{{&quot;form.consent.dataprivacy&quot;|translate}}*&lt;/label&gt;
            &lt;/li&gt;
            &lt;li class=&quot;form-checkbox _smaller-text&quot;&gt;
              &lt;input id=&quot;f-cb15&quot; class=&quot;form-checkbox__input&quot; name=&quot;message[{{&quot;form.consent&quot;|translate}}][]&quot; type=&quot;checkbox&quot; value=&quot;{{&quot;form.consent.userdatas&quot;|translate}}&quot; required&gt;&lt;label for=&quot;f-cb15&quot;&gt;{{&quot;form.consent.userdatas&quot;|translate}}*&lt;/label&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;/div&gt;

        &lt;button id=&quot;contact-form-submit&quot; class=&quot;button&quot; type=&quot;submit&quot; form=&quot;form-jans-contact&quot; value=&quot;Submit&quot; title=&quot;{{ 'form.submit.title.captcha'|translate }}&quot;&gt;
          &lt;div class=&quot;button__decor&quot;&gt;&lt;/div&gt;
          &lt;span class=&quot;button-title&quot;&gt;{{&quot;form.send&quot;|translate}}&lt;/span&gt;
          &lt;span class=&quot;button-arrow&quot;&gt;
            &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;35&quot; height=&quot;20&quot; class=&quot;button-arrow-1&quot; viewBox=&quot;0 0 35 20&quot;&gt;&lt;defs&gt;&lt;clipPath id=&quot;a&quot;&gt;&lt;rect width=&quot;35&quot; height=&quot;20&quot; transform=&quot;translate(1113 6721)&quot; fill=&quot;#fafafa&quot;/&gt;&lt;/clipPath&gt;&lt;/defs&gt;&lt;g transform=&quot;translate(-1113 -6721)&quot; clip-path=&quot;url(#a)&quot;&gt;&lt;g transform=&quot;translate(-1102 10350.023) rotate(-90)&quot;&gt;&lt;path d=&quot;M3622.151,2217.556v31&quot; transform=&quot;translate(-2.798 -0.556)&quot; fill=&quot;none&quot; stroke=&quot;#0f0e0e&quot; stroke-width=&quot;1&quot;/&gt;&lt;path d=&quot;M3613.023,2239l6.33,9,5.67-9&quot; fill=&quot;none&quot; stroke=&quot;#0f0e0e&quot; stroke-width=&quot;1&quot;/&gt;&lt;/g&gt;&lt;/g&gt;&lt;/svg&gt;
          &lt;/span&gt;
        &lt;/button&gt;
        {{ craft.contactFormExtensions.recaptcha | raw }}
      &lt;/div&gt;
    &lt;/form&gt;
</code></pre>
<p><a href="https://i.sstatic.net/Vo0sJ.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Vo0sJ.jpg" alt="enter image description here" /></a></p>

<form><craft4>
Contact Form is not working anymore since upgrading from Craft 3 to 4
# Contact Form is not working anymore since upgrading from Craft 3 to 4

(Asked by: username_0 on 2022-11-12)

After upgrading to Craft 4 non of my Craft Forms are working... getting the error "Symfony\Component\Mime\Address::__construct(): Argument #2 ($name) must be of type string, null given, called in /html/JANS-Staging/vendor/yiisoft/yii2-symfonymailer/src/Message.php on line 368" ... any idea please? 
Also: For me the example code from here https://github.com/craftcms/contact-form/ is working on a fresh installed Craft 4 version, but not on an upgraded one from 3 to 4...  not receiving any mail.
This is my form code:

      {{ csrfInput() }}
      
      
      
      
      {{ redirectInput(craft.entries.section('brochureConfirm').one.url) }}
      
        
          
            
              
                
                  
                    {{"form.yourFirstName"|translate}}*
                    
                  
                
                
                  
                    {{"form.yourLastName"|translate}}*
                    
                  
                
              
              
                
                  
                    {{"form.emailaddress"|translate}}*
                    
                  
                
                
                  
                    {{"form.phone"|translate}}
                    
                  
                
              

              
                
                  
                    {{"career.uploadFiles"|translate}}:
                    
                  
                
              
            

            
              {{"form.yourAddress"|translate}} (Optional)
              
                
                  
                    {{"form.street"|translate}}
                    
                  
                
                
                  
                    {{"form.number"|translate}}
                    
                  
                
              
              
                
                  
                    {{"form.zipcode"|translate}}
                    
                  
                
                
                  
                    {{"form.city"|translate}}
                    
                  
                
              

              
                
                  
                    {{"form.Country"|translate}}
                    
                  
                
                
                  
                    {{"form.comment"|translate}}
                    
                  
                
              
            

            
              {{"form.moreComments"|translate}}
              
                
                  
                    {{"form.comment"|translate}}
                    {{ message.message ?? '' }}
                  
                
              
            

          
        
      

      
        
          
            
              {{"form.consent.dataprivacy"|translate}}*
            
            
              {{"form.consent.userdatas"|translate}}*
            
          
        

        
          
          {{"form.send"|translate}}
          
            
          
        
        {{ craft.contactFormExtensions.recaptcha | raw }}

**Tags:** form, craft4

---

## 1 answers

### Answer by username_1 on 2022-11-12. Score: 4 | Accepted answer

welcome to the CraftCMS StackExchange 
I dug around on the craftcms/contact-form repo and found an open issue for the same error you're describing.
Basically, (as things currently stand) you need to add a field to your form with the name fromName for it to successfully submit. With the upgrade to Craft 4 it seems that fromName joined fromEmail and message as required fields, though that wasn't documented properly.
You could either change up your "First Name" field a bit like so:


Or if you're using some JS on the frontend, you could add a hidden input field:


...and then when your form's submit button is clicked, you could fetch the values of the yourFirstName and yourLastName field and join them and update the value of this hidden field, and then let the form submission proceed as normal. That might be a bit of a complex solution though depending on your familiarity with JS...

> **Comments:**
> **username_0**: Thank you for your answer!! Yes, i found out the same. So with Craft 3 it was working. But in Craft 4 those fields are required for the submit :)  

---

