How to automatically save received pdf files from gmail into a database?

I would like to know if this scenario would be possible in any programming language combined with any database technology.

I would like to automatically save received pdf files that are attached in emails into a database. Is this possible? Is there any library or framework available to do so?

Upvotes: 1

Views: 277

Answers (1)

AMolina
AMolina

Reputation: 1379

Yes, I would recommend using Google Apps Script for this. The approach you should follow is to use the GmailApp class (Documentation here) to get the messages you need, you can use methods like getInboxThreads() (Documentation), to retrieve the messages.

After you've found the message and retrieved the attachment (which you can do withgetAttachments() (Documentation)), you can use the JDBC Service to connect with external databases. The specifics here depend a lot on what database you want to connect with, but the documentation will lead you in the right direction.

Upvotes: 1

Related Questions