In my Gmail-addon, I want to be able to read the raw (MIME) message of the current email.
How can I do that?
You can retrieve the message ID of the current message using e.messageMetadata.messageId
at function buildAddOn(e){}
. I cannot uderstand about raw (MIME) message
in your question. So I propose 2 patterns.
Byte[]
, you can retrieve it from message ID using Gmail.Users.Messages.get()
of Advanced Google Services as follows.
Gmail.Users.Messages.get("me", messageId, {format: "RAW"}).raw
String
, you can retrieve it from message ID using GmailApp.getMessageById()
as follows.
GmailApp.getMessageById(messageId).getRawContent()
"https://www.googleapis.com/auth/gmail.addons.execute", "https://mail.google.com/"
to the scopes.
If I misunderstand your question, I'm sorry.