Home arrow PHP arrow Composing Messages in HTML for MIME Email with PHP

Composing Messages in HTML for MIME Email with PHP

Welcome to the fourth episode of the series, "Sending MIME email with PHP." In this article, Iím going to show you how to provide the MIME mailer class with the ability to send email messages in HTML format. This will greatly extend its functionality, so don't miss this tutorial.

  1. Composing Messages in HTML for MIME Email with PHP
  2. Review: sending MIME-compliant messages in plain text format
  3. Sending email messages in HTML format
  4. Sending email in HTML format using the MIME mailer class
By: Alejandro Gervasio
Rating: starstarstarstarstar / 6
July 30, 2008

print this article



The Multipurpose Internet Mail Extension (short for MIME) permits, among other things, sending email messages in HTML format, working with different types of attached files, and so forth. But, the good news here is that you can use all the features offered by MIME directly with PHP. You can develop applications that dispatch MIME-compliant messages to a bunch of recipients.

Naturally, sending MIME email with PHP can be done using either a procedural or an object-oriented approach. If youíre interested in utilizing this latter, youíll find a friendly guide on building a highly modular MIME mailer class in this series of articles. It utilizes this extension in order to send messages in both plain text and HTML format. It also supports working with file attachments.

At this point, I should assume that youíre well aware of the goals of this series. Thus, itís an excellent time to rehash the topics covered in the last tutorial, in case you haven't had the chance to read it yet. In that particular article, I demonstrated how to improve the signature of the MIME mailer class that I built in the beginning of this series by adding a brand new property, called ď$mimeTypes,Ē to it. This helped store all the MIME types supported by the class, when dealing with file attachments.

Of course, after introducing this minor modification to the signature of the aforementioned mailer class, its whole structure looked more compact and more efficient. Nonetheless, my primary intention here is to teach you how to create an expansible PHP class that takes real advantage of the MIME extension.

With the preliminaries out of our way, letís jump forward and see how to add HTML capabilities to this MIME mailer class. Itís going to be an instructive experience!

>>> More PHP Articles          >>> More By Alejandro Gervasio

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: