I’m using node imap :
https://www.npmjs.com/package/node-imap
i have this method to save message as draft
imap.once('ready', () => {
imap.openBox('Drafts', false, (err, box) => {
if (err) throw err;
let msg, htmlEntity, plainEntity;
msg = mimemessage.factory({
contentType: 'multipart/alternate',
body: []
});
htmlEntity = mimemessage.factory({
contentType: 'text/html;charset=utf-8',
body: 'Draft Mail'
});
plainEntity = mimemessage.factory({
body: 'Draft Mail'
});
msg.header('Message-ID', '<msgId>');
msg.header('To','[email protected]');
msg.header('Subject', 'Mail');
msg.body.push(plainEntity);
imap.append(msg.toString());
})
});
I want to add attachment also in this mail and save this as a draft, any solution thanks