APIs & Integrations

CMDAgency
Mitglied

Custom SMTP Message Headers

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'
}

 

0 Upvotes
2 Antworten
IsaacTakushi
HubSpot Employee
HubSpot Employee

Custom SMTP Message Headers

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

Associate Certification Manager
0 Upvotes
CMDAgency
Mitglied

Custom SMTP Message Headers

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

 

0 Upvotes