Home arrow PHP arrow Page 7 - Building A PHP-Based Mail Client (part 2)

Miles To Go - PHP

Now that you've got a basic mail reader up and running, it's timeto learn a little more about attachments. This second segment analyzesMIME-encoded attachments, demonstrating how to decode and download them,and then integrates attachment handling features into the primitive mailclient previously demonstrated.

  1. Building A PHP-Based Mail Client (part 2)
  2. A Picture Is Worth A Thousand Words
  3. The Way Things Work
  4. Structure And Syntax
  5. Room With A View
  6. Getting Down
  7. Miles To Go
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 12
January 11, 2002

print this article


At this point, I'm fairly pleased with myself. I've succeeded in writing a fully-functional POP3 mail reader, one which is capable of connecting to any POP3 server, retrieving messages from it, and handling MIME-compliant attachments gracefully. Sure, it's not perfect - I've noticed problems with certain types of messages - but those are easily handled by appropriate additions to the parse() function, or by additional checks in "view.php", and you may even decide to ignore them if you're happy with the way the program currently works.

Hopefully, you've also learned a lot more about PHP's IMAP functions. This article introduced you to a few more important pieces of the puzzle, demonstrating how PHP's IMAP functions allow you to obtain detailed structural information on an email message, and extract individual segments from it for further processing. It also provided a crash course on MIME, using examples and theory to set the base for a practical implementation of MIME-based attachment handling.

We're now a lot closer to the end of this case study - all that's left is to write code to handle the four additional functions of compose, reply, forward and send. Come back for the final segment of this case study, and find out more about how I plan to handle these functions, together with a look at the process of constructing a MIME message and a brief discussion of the error handler used throughout this article.

Note: All examples in this article have been tested on Linux/ig86 with Apache 1.3.12 and PHP 4.0.6. Examples are illustrative only, and are not meant for a production environment. Melonfire provides no warranties or support for the source code described in this article. YMMV!

>>> More PHP Articles          >>> More By icarus, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: