PHP : How to download dot csv file from my gmail Account?
-
13-06-2021 - |
Question
i have thousand of email in my gmail account.In the email i have a many files in each email but i need to download a file with csv extension and copy it to folder in my PC. Any idea how would i do this in PHP ??
Solution
You may find this useful, for the basics of connecting to gmail from PHP/IMAP.
And here is more detailed info about getting attachments via IMAP.
You can easily filter the attachments by filename to get only .CSV files, using preg_match() or even strpos().
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow