diff --git a/back/mails/storeMessage.js b/back/mails/storeMessage.js index 0be8398..3bde719 100644 --- a/back/mails/storeMessage.js +++ b/back/mails/storeMessage.js @@ -92,9 +92,15 @@ async function saveFromParsedData(parsed, messageId) { } else if (["html", "text", "textAsHtml"].includes(key)) { const hash = "0"; const size = "0"; + let partType = "text/plain"; + if (key == "html") { + partType = "text/html"; + } else if (key == "textAsHtml") { + partType = "text/TexAsHtml"; + } saveBodypart(size, hash, parsed[key], "").then((bodypartId) => { getFieldId(key).then((fieldId) => { - saveHeader_fields(messageId, fieldId, bodypartId, undefined, undefined); + saveHeader_fields(messageId, fieldId, bodypartId, partType, undefined); }); }); } else if (key == "attachments") {