# Mautic 2.16.1 Campaign email error value has type 'number' when expecting type 'string'

**URL:** <https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779>\
**Category:** Product Support\
**Created:** [April 3, 2020, 6:51pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779 "2020-04-03T18:51:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![versadial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/versadial/32/623_2.png) [@versadial](https://forum.mautic.org/u/versadial)\
**Post date:** [April 3, 2020, 6:51pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/1 "2020-04-03T18:51:12Z")

</div>

**Your software**  
My Mautic version is: 2.16.1  
My PHP version is: 7.1 (also tried on 7.3)

**Your problem**  
My problem is: After upgrading from 2.15 to 2.16.1…emails being sent in Campaign do not execute. They have the error:  
**Last execution error: content.headers json dictionary value has type ‘number’ when expecting type 'string’**

These errors are showing in the log:  
mautic.ERROR: [MAIL ERROR] content.headers json dictionary value has type ‘number’ when expecting type ‘string’ Log data: !! content.headers json dictionary value has type ‘number’ when expecting type ‘string’ (code: 0) (send); EMAILVALUE, EMAILVALUE {“exception”:"[object] (Swift\_TransportException(code: 0): content.headers json dictionary value has type ‘number’ when expecting type ‘string’\nLog data:\n!! content.headers json dictionary value has type ‘number’ when expecting type ‘string’ (code: 0) at /home/public\_html/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:140)"}

Steps I have tried to fix the problem: Update Schema, changed PHP versions, Clear Cache. Tried going into the campaign and resaviing it. Attempted to update Email in campaign as well. Same error. Note, I do not have access ot SSH, all attempts are manual for schema and cache clear.

---

<div class="post-metadata">

**Author:** ![versadial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/versadial/32/623_2.png) [@versadial](https://forum.mautic.org/u/versadial)\
**Post date:** [April 13, 2020, 7:08pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/2 "2020-04-13T19:08:18Z")

</div>

I did a complete new install except for the database. Deleted all files, uploaded 2.16.2, and then set up and did schema update…but still, same error with headers. Is this a bug? or is this a server issues? or is this a database issue? Any guidance into where to dig further would be appreciated. Im surprised no one else is having this issue.

---

<div class="post-metadata">

**Author:** ![dennisameling](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dennisameling/32/958_2.png) [@dennisameling](https://forum.mautic.org/u/dennisameling)\
**Post date:** [April 13, 2020, 7:29pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/3 "2020-04-13T19:29:51Z")

</div>

@versadial  
Thanks for providing this log entry and for doing the new installation.

My wild guess is that one of your emails has some content in it that is somehow not compatible with the new Mautic version, but that’s a very rough indication so please take it with a grain of salt. Just trying to understand what exactly is going wrong.

To help us better understand the issue, could you please:

1. Create a new email from scratch to see if you’re experiencing the same issue when sending that email?
2. What is your email provider (PHP Mail/Sendgrid/etc.)? Another user seems to have the same issue and is using Sparkpost: [https://github.com/mautic/mautic/issues/8621](https://github.com/mautic/mautic/issues/8621)

---

<div class="post-metadata">

**Author:** ![rehansaleem](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rehansaleem/32/398_2.png) [@rehansaleem](https://forum.mautic.org/u/rehansaleem)\
**Post date:** [April 13, 2020, 7:35pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/4 "2020-04-13T19:35:17Z")

</div>

I’m also facing the same issue, actually i thought the same i removed all the emails and created new it did’t work and then i updated from fresh install of 2.15.3 to 2.16.2 and having same problem.

It is happening with sparpost and gmail smtp server.

`mautic.ERROR: [MAIL ERROR] content.headers json dictionary value has type 'number' when expecting type 'string' Log data: !! content.headers json dictionary value has type 'number' when expecting type 'string' (code: 0) (send); ` `myemail@domain.com` ` {"exception":"[object] (Swift_TransportException(code: 0): content.headers json dictionary value has type 'number' when expecting type 'string'\nLog data:\n!! content.headers json dictionary value has type 'number' when expecting type 'string' (code: 0) at /var/www/html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:140)"} []`

Thanks.

---

<div class="post-metadata">

**Author:** ![versadial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/versadial/32/623_2.png) [@versadial](https://forum.mautic.org/u/versadial)\
**Post date:** [April 14, 2020, 3:34pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/5 "2020-04-14T15:34:04Z")

</div>

Bingo!

It’s sparkpost, I too have sparkpost. Wow, I would not have even considered that, as the error I have seen people complain is in regards to connecting to their external email source.

So confirmed, it is sparkpost related.

I tested with PHP email, and all worked. Similar to the github post, the Test email goes through fine, but the Campaign emails are the ones that have the issue.

Is this something Sparkpost developers should look into, or is it still related to mautic developers needing to patch how they communicate with sparkpost?

Thank you!

---

<div class="post-metadata">

**Author:** ![versadial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/versadial/32/623_2.png) [@versadial](https://forum.mautic.org/u/versadial)\
**Post date:** [April 14, 2020, 3:35pm UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/6 "2020-04-14T15:35:09Z")

</div>

Did you try PHP mail? Perhaps, not only Sparkpost, but also other third party email such as Gmail too.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [June 17, 2020, 7:33am UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/7 "2020-06-17T07:33:43Z")

</div>

I am interested to find out if someone has a solution for this. I have recently considered moving over my clients to SparkPost, and had an amazing talk with their sales rep. I am excited to move over, but when I went ahead and tested I got the same errors.  
Changed system back to SendGrid and mailers went out no problem

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [July 6, 2020, 10:00am UTC](https://forum.mautic.org/t/mautic-2-16-1-campaign-email-error-value-has-type-number-when-expecting-type-string/13779/8 "2020-07-06T10:00:16Z")

</div>

Hi folks, Just following up that this was fixed with [this PR](https://github.com/mautic/mautic/pull/8703) in Mautic 3.0.
