# SendGrid addHeader X-SMTPAPI

**URL:** https://forum.mautic.org/t/sendgrid-addheader-x-smtpapi/31912
**Category:** Product Support
**Created:** [April 30, 2024, 2:17pm UTC](https://forum.mautic.org/t/sendgrid-addheader-x-smtpapi/31912 "2024-04-30T14:17:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sirchuck](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sirchuck](https://forum.mautic.org/u/sirchuck)
#### Post date: [April 30, 2024, 2:17pm UTC](https://forum.mautic.org/t/sendgrid-addheader-x-smtpapi/31912/1 "2024-04-30T14:17:16Z")

</div>

My PHP version is: 7.4.33  
My problem is: Using the official SendGrid PHP Library on GitHub, I can not seem to send the header: X-SMTPAPI.

I have tried setting the basic PHP header(), The API’s addHeader() and the API’s addGlobalHeader() with no luck.

My php line is a very simply json string that looks like this:  
$email-\>addHeader(‘X-SMTPAPI’, ‘{“unique\_args”:{“id1”:"’.$id1.‘“,“id2”:”’.$id2.‘“,“id3”:”’.$id3.‘"}}’);

I get no errors, but for some reason SendGrid does not seem to process the header so I can use those variables later from the SendGrid Webhook.

Passing X-SMTPAPI this way from Ruby’s mailer works fine.

Note: I’m not 100% sure Muatic has anything to do with this I stumbled across a note somewhere suggesting to try here. Apologies if not your product.

Steps I have tried to fix the problem: There is very little help on the internet for this particular problem, other than one post I stumbled across suggesting it doesn’t work, but not specific as to why not.

Thanks in advance!
