I'm using Gmail API to send messages using endpoint as listed here https://developers.google.com/gmail/api/v1/reference/users/messages/send
Using the headers References
and In-Reply-To
threading works perfectly. However I'm unable to get the earlier messages quoted in the reply as would happen if the reply is composed in Gmail. Is there a way to do this or if there's a workaround?
If you go from Gmail UI to Show original
you will see that the quotation of earlier messages is just part of the new message body:
For this you can retrieve the date from the headers and the message text the data of the previous message body, and then create manually a string that appends the data
after >
.
Append then this manually created string to the end of your new message body.