0

I want to read new mails from Gmail and save them in Dropbox. I have done the code to get mails of a user and save it in dropbox. But as the message object is returned back from Gmail API its a JSON and currently i am saving it as a text file in dropbox. Is their any way by which i can save it as .eml, say any export API by Gmail.

Or any hint from any one how I should save mails to Dropbox as we want to achieve that by double clicking on the file the message can be opened in default mail viewer of user.

naruto
  • 1
  • 1

1 Answers1

2

It depends on the specific format, because according to this post, .eml files may or may not conform to a standard. However, the user points out that one standard is described by RFC 822.

That being said, according to the Gmail API documentation, the raw field looks like it contains what you need:

The entire email message in an RFC 2822 formatted and base64url encoded string.

(RFC 2822 obsoletes RFC 822.)

Hope this helps.

Community
  • 1
  • 1
Reticulated Spline
  • 1,892
  • 1
  • 18
  • 20