Mail client using PHP IMAP extension

Select your language

This is standalone php script which I have titled "Mail client using PHP IMAP extension". This is being used as cron job to run after set period of time.
This script connects mysql database, then open imap connection stream to given server details(host, user, password). Then read their inbox for any new emails, fetch all details containing sender, subject, datetime, body, attachment of emails. Next matches sender from sender table in database, if found process next else email back with given condition response.
After that it download attachments, for now it is working on csv (comma separated) attachment, and write down them to the server, their content then are written to the database. After all operations are successful. It respond to sender email a successful email.
A useful script without checking email and attachments manually, it save time and do everthing you needed automatically.
In last it moves read email into other folder, for now called "Imported" folder.