I have a software package that can reference file names in an email, but cannot generate the email with file attachments from an FTP folder. To accomplish this, I made the software generate an email as a template (like XML) that references files I want to attach from my FTP server.
I would like a python script that will run on a scheduled cron to do the following:
1) Log into a gmail account, parse an email template body to extract file names, recipients, and text information from the body of the email (The items to extract will be within tags for easy parsing)
2) Download the attached PDF file from the email and place it in an FTP folder
3) Using the file names from step #1, find the matching file(s) from an FTP folder and convert them to PDF (from Docx).
4) Compile an outgoing email that attaches all the files above from the FTP folders and formats an outgoing email based on the text and recipient tags. The files should be zipped.
5) Purge the email inbox.
I have attached a sample of how an email template can look. It can be modified slightly if needed to make the coding easier.
To make this project even sweeter, I have already written a somewhat functional script that does most of this project (logs in to the gmail, parses, converts to PDF, uploads, downloads, archives, purges the inbox, etc). It needs to be refined and tested.
Hello, I'm a Python programmer interested in this project. In my understanding, I need to do the FTP part and glue all other modules that you have already made to create a working system. Regards,