Closed GTP95 closed 2 years ago
I don't think so. You'll have to map the attachment extension against known mime-types.
There's npm-packages for that though. I just took a quick search and the first thing I found was this:
Thanks for your answer. I found an alternative way that I'll report here for future reference, but unfortunately seems that Gmail changes the content-type so I can't rely on it and I have to find a workaround. Anyway to get the content-type:
gmail.observe.on("view_email", (domEmail) => {
const emailData = gmail.new.get.email_data(domEmail);
const attachments = emailData.attachments;
const type=attachment.type //this gets the MIME type
});
Greetings,
Is there a method get the MIME type of an attachment of a received email? A quick search didn't turn up anything. Thank you fir your help,
GTP