News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
DevShed:
A Better Way to Determine MIME Types for MIME Email with PHP
July 24, 2008 @ 07:53:18

Continuing on in their look at sending MIME emails with PHP, DevShed has posted a better way for you to determine the correct MIME type of the file you're wanting to send (third part of the series).

I demonstrated how to build a modular MIME mailer class in PHP 4; it was provided with the capacity to send messages in plain text, and to work with different types of file attachments. This class implements a private method, called "getMimeTypes()," which, as its name would suggest, comes in handy for determining the correct MIME type of a given file. [...] However, the logic implemented by this method is rather primitive and can definitely be improved.

They start with a review of the previous code (PHP4) and show how to get the correct mime type of the file based on the extension mapped to an array of types.

0 comments voice your opinion now!
mime tutorial type mail php4 class getmimetypes extension



Similar Posts

Pádraic Brady's Blog: Filter Extension Issues - A Storm in a Teacup?

PHPBuilder.com: File uploads made easy

IBM developerWorks: Developing PHP the Ajax way, Part 1 - Getting started

Ibzi's Blog: Start caching all your pages in 5 steps

Zend Developer Zone: Live Blogging From php/db|works 2006


Community Events









Don't see your event here?
Let us know!


mysql code book cakephp job zendframework PHP5 security releases PEAR zend example ajax database application conference developer release framework package

All content copyright, 2009 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework