@Samuel.R I was debugging this issue for a couple of days, and I pasted the wrong data to you,
below is the payload that I pass to the send fn of Nylas. Now I am assuming it will auto-switch to multipart behind the scenes.
{
grantId: "xxx",
body: "<html><p><br><br></p><p></p><table style=\"color: rgb(136, 136, 136); font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; border: none; border-collapse: collapse; min-width: 50px\"><colgroup><col style=\"min-width: 25px\"><col style=\"min-width: 25px\"></colgroup><tbody><tr style=\"height: 55.6017pt;\"><td rowspan=\"1\" colspan=\"1\" style=\"margin: 0px; border-right: 0.6pt solid rgb(217, 217, 217); vertical-align: middle; padding: 2pt; overflow: hidden;\"><p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><img height=\"23\" width=\"82\" src=\"cid:image-0\" style=\"margin-left: 0px; margin-top: 0px;\"></p></td><td rowspan=\"1\" colspan=\"1\" style=\"margin: 0px; border-left: 0.6pt solid rgb(217, 217, 217); vertical-align: top; padding: 5pt; overflow: hidden;\"><p style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;\"></p></td></tr></tbody></table></html>",
subject: "Testing nylas",
to: [
{
email: "ahsanakhtar@gmail.com",
},
],
attachments: [
{
filename: "image-0.png",
contentType: "image/png",
contentBase64: "iVBORw0KGgoAAAANSUhEUgAAAsQAAADICAYAAADvCPfRAAAlCEEYFnLd9jF+vES3pT/B2f7sKN5DkOtTMdgpVLIxJ9s8lWzMRyHnqWRFG3/7hL4rc0+GPxh57+WjbTyOkR/hq1r5NUH+nRG8hyDXp2KwU6hkY062eSrZmI9CzlPJyhg0cuz2fPvNSuE16DdnK7kNXtHGY2nkY9jbrPyeRv69EbyHINenYrBTqGRjTrZ5zh8gX7JLv8oR+tGmPMC/B/AaG6uzb0NqgzAAAAAElFTkSuQmCC", //dummy
contentId: "image-0",
},
{
contentType: "application/pdf",
filename: "Free_Test_Data_6MB_PDF.pdf",
contentStream: {
_events: {
close: undefined,
error: undefined,
data: undefined,
end: undefined,
readable: undefined,
},
_readableState: {
highWaterMark: 16,
buffer: [
],
bufferIndex: 0,
length: 0,
pipes: [
],
awaitDrainWriters: null,
},
_read: function(){
this.push(iterable);this.push(null);
},
_maxListeners: undefined,
},
contentId: "54e63e27-a400-4061-a6c6-da596c9fdc8e",
isInline: false,
contentDisposition: "attachment",
size: 6235548,
},
],
trackingOptions: {
threadReplies: true,
},
}
the response I get back from Nylas
{
body: "<html><p><br><br></p><p></p><table style=\"color: rgb(136, 136, 136); font-family: Arial, Helvetica, sans-serif; font-size: small; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; border: none; border-collapse: collapse; min-width: 50px\"><colgroup><col style=\"min-width: 25px\"><col style=\"min-width: 25px\"></colgroup><tbody><tr style=\"height: 55.6017pt;\"><td rowspan=\"1\" colspan=\"1\" style=\"margin: 0px; border-right: 0.6pt solid rgb(217, 217, 217); vertical-align: middle; padding: 2pt; overflow: hidden;\"><p style=\"line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;\"><img height=\"23\" width=\"82\" src=\"cid:image-0\" style=\"margin-left: 0px; margin-top: 0px;\"></p></td><td rowspan=\"1\" colspan=\"1\" style=\"margin: 0px; border-left: 0.6pt solid rgb(217, 217, 217); vertical-align: top; padding: 5pt; overflow: hidden;\"><p style=\"line-height: 1.2; margin-top: 0pt; margin-bottom: 0pt;\"></p></td></tr></tbody></table></html>",
attachments: [
{
id: "v0:RnJlZV9UZXN0X0RhdGFfNk1CX1BERi5wZGY=:YXBwbGljYXRpb24vcGRm:6235548",
filename: "Free_Test_Data_6MB_PDF.pdf",
size: 6235548,
contentType: "application/pdf",
isInline: false,
contentDisposition: "attachment; filename=\"Free_Test_Data_6MB_PDF.pdf\"",
},
{
id: "v0:aW1hZ2UtMC5wbmc=:aW1hZ2UvcG5n:12716",
filename: "image-0.png",
size: 12716,
contentType: "image/png",
isInline: false,
contentDisposition: "attachment; filename=\"image-0.png\"",
},
],
from: [
{
name: "Tech Eng",
email: "abbc@abc.so",
},
],
object: "message",
subject: "Testing nylas", // dummy
to: [
{
email: "hallucinogenizer@gmail.com",// dummy
},
],
folders: [
"SENT",
],
trackingOptions: {
label: "",
links: null,
opens: null,
threadReplies: true,
},
threadId: "19a9cd50b2ac0f55",
date: 1763567790,
requestId: "724019751-7b84dd0f-6270-4f77-a26e-29d9fe37dbdb",
grantId: "xx",
id: "19a9cd50b2ac0f55",
}
Now if you could spot the error please, it would just be very helpful, I am stuck in this debugging for the past few days.