In this four-part series of articles we are going to build an email client with PHP. I will try to implement a full email client with all the functionality that you would expect from an email client, which includes a trash folder, sent items folder and a draft folder. But that's not all.
We will also try to deal with the one issue that you don't see in other PHP email client tutorials, which are attachments. I have searched the Internet for examples of how to find attachments in a mail message and could not find any. So I've decided to work it out myself and integrate it into this email client. We will use MySQL to store all the email data. In fact, the mail information will all be retrieved from the database.
Tools you need
You will need a copy of PHP 4.x MYSQL. Also, make sure that you have imap enabled on your PHP installation. You do this simply by removing the semicolon in the "Extensions" section of your PHP-ini file.