0

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 ??

hakre
  • 193,403
  • 52
  • 435
  • 836
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53

1 Answers1

2

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().