I'm writing a Chrome extension that builds on Gmail and which needs to add several proprietary header fields to the mail header before the message is sent. My app logic goes as follows: after the user composes a message in Gmail and presses Send button, code in the content script intercepts the Click event and I create the header fields. So my question is, how do I access the mail header where I can insert the new fields? I'm looking for something like Message.setHeader() in JavaMail and Android.
You can't.
Gmail doesn't have a provision for the user to add any headers other than Reply-To.
But, if you can show how to manually add a custom header, then we can show you how to automate that with a content script.
Until then, to send an X-header, you'll have to use a different email client. Configure Thunderbird, for example, to use Gmail via IMAP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With