KartikTalwar / gmail.js

Gmail JavaScript API
MIT License
3.74k stars 455 forks source link

Set MIME header #704

Closed GTP95 closed 2 years ago

GTP95 commented 2 years ago

Hello,

I'm adding an attachment to a Gmail e-mail using the hack suggested here. But now I need to specify the MIME header for the attachment, I would need to add the following header:

Content-Type: application/postguard;
name="postguard.encrypted"
Content-Transfer-Encoding: base64"

Is there any way to do this?

Thank you for your help

josteink commented 2 years ago

Its a hack. It’s undocumented and unsupported even by Gmail.js standards.

You may ask @TheSharpieOne though?

TheSharpieOne commented 2 years ago

When creating the file using new File([blob], filename, options). Options can specify a mime type (and last modified), but that is it. Check out https://developer.mozilla.org/en-US/docs/Web/API/File/File

GTP95 commented 2 years ago

This works, thanks!