Thank you all in advance.
Is it possible to send an email via the GMAIL RESTful API (https://www.googleapis.com/upload/gmail/v1/users/me/messages/send?uploadType=media) without saving a copy in the sent folder?
I have seen implementations in Outlook (Exchange/REST/Graph APIs) where emails can be sent without having copies in the sent folder. I was wondering if this is possible with the GMail APIs as well.
Again, thanks.
Workaround:
Currently, sending an email using Gmail API will always create a copy in the SENT folder, but one workaround you can do is:
timestamp
before sending the message.messages.send
.users.messages.list
with query parameter labelIds=SENT
(note: this is case-sensitive) and ?q=in:sent after:<timestamp>
to list the most recent sent message.users.messages.delete
and use the ID fetched from the previous call as the parameter.References: