Custom SMTP Message Headers

New Contributor

Is there any way we can set custom smtp headers in a single send / transactional api call?

 

For instance I am trying to send in a X-CustomHeader into the Email Message Headers.  To clarify, I am not talking about the html header/footer, I am referring to Headers you can analyze via MHA in Outlook.

 

I have researched this in the api documentation, but cannot find an answer.

 

I have also tried amending fields into the json request to test, but have not had success.

 

Example:

 

{
"emailId": 1250459XXXX ,
"x-custom1" : "test1",
"message": {
"to": "x1234@myagency.com",
"cc": ["x12345@myagency.com"],
"bcc": ["bcc@myagency.com"],
"x-customHeader2" : 'Test321'
}

 

Reply
0 Upvotes
2 Replies 2
Highlighted
HubSpot Moderator

Hi, @CMDAgency.

 

While this isn't possible with the Single-send API since it leverages email templates created in HubSpot, you might be able to do this with the SMTP API

 

The SMTP API simply generates SMTP tokens, leaving you to build and send the emails from your own service. Some popular clients include MailKit and MimeKit. You should be able to define whatever headers you want with SMTP clients like these.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

Hi Isaac,

Unfortunately that solution proposed would not work for us as we already transfered 40 templates and this would require us to move that rendering to server side.

But thank you for the recommendation.

MZ

 

Reply
0 Upvotes