PHP
  Home arrow PHP arrow Page 4 - A Better Way to Determine MIME Types for MIME Email with PHP
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

A Better Way to Determine MIME Types for MIME Email with PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 1
    2008-07-23


    Table of Contents:
  • A Better Way to Determine MIME Types for MIME Email with PHP
  • Review: sending MIME-compliant email messages with PHP 4
  • Modifying the signature of the “Mailer” class
  • Putting the modified “Mailer” class to work

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    A Better Way to Determine MIME Types for MIME Email with PHP - Putting the modified “Mailer” class to work
    ( Page 4 of 4 )

    Below I coded a final hands-on example that demonstrates how to use the “Mailer” class, after its original signature has been modified.

    Here is the corresponding code sample:


    // create a new instance of the 'Mailer' class

    $mailer=&new Mailer('alejandro@mydomain.com,'mybuddy@yourdomain.com','Testing mailer class','Hello buddy. I am sending you a couple of fun images.');

    // add some attachments

    $mailer->addAttachment('file1.jpg');

    $mailer->addAttachment('file.jpg');

    // send MIME email

    $mailer->send();


    As you can see, changing the way  the “Mailer” class does some of its things doesn’t imply that its API must change too. The above example demonstrates this concept very clearly, since the steps taken to use the class in question are the same steps you learned in the two previous tutorials of the series.

    And lastly, here’s my final suggestion: feel free to introduce your own modifications to the pertaining “Mailer” class, not only to extend its functionality, but to improve your background in sending MIME email with PHP.

    Final thoughts

    In this third episode of the series, I showed you how to improve the business logic of the previous MIME mailer class, specifically when it comes to determining the MIME type of the attached files. As you saw before, this process was performed by creating an additional array of class properties. So you shouldn’t have major problems understanding how it functions.

    In the next article, I’m going to continue extending the functionality of this MIME mailer class by providing it with the capacity to send email messages in HTML format.

    The article will be insightful, trust me. I hope you don’t miss the upcoming tutorial!



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

       

    PHP ARTICLES

    - Implementing Factory Methods in PHP 5
    - Merging a File Split for FTP Upload using PHP
    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek