This tutorial explains how to edit remote files phpstorm. Using phpstorm it is possible to edit the remote files without downloading the files. This will automatically upload the files to the server on save.
Here it shows how to connect to the remote sever using the FTP details.Please follow the tutorial for step by step explanation.
This post explains how to send files as attachment PHP. It sends all the files in folder as an attachment using PHP. Then how to move the files to an archive folder and delete the emailed files from the source or placeholder folder.
The following code can set as cron job as well. The cron that send multiple files as attachment together and moved the attached files from the original folder to the archive folder .