[thelist] Sending Tabular data with mail()

Jeffrey Barke jeffrey.barke at themechanism.com
Fri May 23 09:34:09 CDT 2008

> Jeffrey Barke wrote:
>> Santilal,
>> PHP's mail function sends a plain text email, not an HTML one, so no
>> markup is necessary or will work.
> There's nothing stopping you sending html emails using php's mail()
> function but you have to send it multipart.
> I set a system up for doing this some years ago and it was rather  
> crude
> but it worked. It looked something like this:

Good point, Chris, and I regret I didn't mention this. I only use  
PHP's mail() function directly for text emails and use Richard Heyes'  
for HTML and other multipart messages.

     *  Can send email with To,Cc, Bcc and Reply-To recipients
     * Can send email using the PHP mail() function, piping direct to  
Sendmail, Postfix, Exim and also via SMTP
     * Multipart email, with HTML and plain text for clients that  
don't support HTML
     * All encoding types supported: 7bit, 8bit, Base64 and Quoted- 
     * Easy to use API
     * Supports SMTP authentication
     * Works with Windows and Unix/Linux
     * Allows any headers to be set, including your own custom headers
     * Allows email priorities to be set
     * Allows the character set to be set for headers and the email  
body, giving non-English support
     * Add attachments or embed images from files, or PHP strings (eg  
for images/files held in databases)
     * Allows Return-Path to be set (for controlling where bounces are  
sent to)
     * Can return the resulting email instead of sending, to allow  
attaching of emails to other emails
     * Full API list
     * Five Comprehensive example scripts


More information about the thelist mailing list