I need two scripts to be written
=================================================
SCRIPT#1 -- Email attachments in Phython.
=================================================
Background: I need to send specific files from a directory to various customers.
OS: Windows Server 2003
1. Read all the files from "Directory"
2. If file exists, then continue with the steps below, otherwise, EXIT immediatley.
3. Run a batch file to ZIP all the files in Directory (I will provide the batch file with ZIP commands)
4. Move all the files from the Directory to C:\...\Directory\Old
5. Grab ZIP attachment from specified directory
6. Send attachment by GMAIL to specified (up to 3 destinations)
7. Ability to enter the subject field
8. Include the files read from Directory in the content of the email
9. Ability to enter additional text in the body of the email.
Example
To run the script: [login to view URL] [login to view URL]
Inside the [login to view URL] file..
<Customer 1>
<sender> sender </sender>
<sender_password> abc123 </sender_password>
<email1> email1 </email1>
<email2> email2 </email2>
<email3> email3 </email3>
<directory> c:\files\customer1 </directory>
<attachment> c:\files\customer1\[login to view URL] </attachment>
<subject> File as Requested </subject>
<Content> Please let us know if you have any questions [list files in directory, now zip] </content>
<Log> c:\...\File_Log_Customer1 </Log> <!--this is where you would store the files read from the Directory-->
</Customer 1>
<Customer 2>
<sender> sender </sender>
<sender_password> abc123 </sender_password>
<email1> email123 </email1>
<email2> email223 </email2>
<email3> email323 </email3>
<directory> c:\files\customer2 </directory>
<attachment> c:\files\customer2\[login to view URL] </attachment>
<subject> File as Requested </subject>
<Content> Please let us know if you have any questions [list files in directory, now zip] </content>
<Log> c:\...\File_Log_Customer1 </Log> <!--this is where you would store the files read from the Directory-->
</Customer 2>
I will need to send more than 1 customer.. so the XML script could have potentially 100 customers.
=====================================
SCRIPT# 2 Check new files in FTP server
=====================================
Need a Phython script to log into FTP server and check if there are new files.
I will run the Phython script under a Scheduled Task in Windows Server.
1. Log into FTP server
2. Check for new files since last successful log-in
3. Email individuals that new files have arrived
Example
To run the script: [login to view URL] [login to view URL]
Inside the [login to view URL] file..
<Customer 1>
<sender> sender </sender>
<sender_password> abc123 </sender_password>
<email1> email1 </email1>
<email2> email2 </email2>
<email3> email3 </email3>
<subject> New files have arrived for <Customer 1> </subject>
<content> The following files have arrived.. [list all files here] </content>
<FTP server>FTP://[login to view URL]</FTP Server>
<FTP Login>Customer1<FTP Login>
<FTP Password>abc123<FTP Password>
<Log> c:\...\FTP_Server_Log_Customer1 </Log> <!--this is where you would store the files read from the FTP site and compare with the next run -->
</Customer 1>
<Customer 1>
<sender> sender </sender>
<sender_password> abc123 </sender_password>
<email1> email1 </email1>
<email2> email2 </email2>
<email3> email3 </email3>
<subject> New files have arrived for <Customer 1> </subject>
<content> The following files have arrived.. [list all files here] </content>
<FTP server>FTP://[login to view URL]</FTP Server>
<FTP Login>Customer2<FTP Login>
<FTP Password>abc123<FTP Password>
<Log> c:\...\FTP_Server_Log_Customer1 </Log> <!--this is where you would store the files read from the FTP site and compare with the next run -->
</Customer 1>
Hi. I can develop the scripts for you. I have already been doing scripts like that as parts of bigger Python projects. I have got experience with this kind of stuff. Kind Regards