Decoding mail attachments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am having trouble running the example from: 
http://www.theukwebdesigncompany.co...code-module.php

Am running PHP5.0.2 running on a windows XP box.

I've setup the test email message as:

PHP Code:
$input = "Return-Path: <gvtulder@xxxxxxxxxxx>
Delivered-To: gijs@localhost
Received: (qmail 4400 invoked from network); 6 Mar 2003 18:13:52 -0000
Received: from unknown (HELO localhost) (gijs@xxxxxxxxx)
  by localhost with SMTP; 6 Mar 2003 18:13:52 -0000
X-Flags: 0000
Delivered-To: GMX delivery to gvtulder@xxxxxxxxxxx
<!-- snip snip -->"

$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$params['input'] = $input;

// do the decode
$structure = Mail_mimeDecode::decode($params);

// save the attachment as a file.
foreach ($structure->parts as $part) {
    // only save if an attachment
    if (isset($part->disposition) and ($part->disposition=='attachment')) {
        // open file
        $fp = fopen($part->ctype_parameters['filename'], 'w');
        // write body
        fwrite($fp, $part->body);
        // close file
        fclose($fp);
    }
}



I've included the correct PEAR file..and all quotation marks are escaped 
properly in the $input. However I get the following message:

Fatal error: Using $this when not in object context in 
c:\php5\PEAR\Mail\mimeDecode.php on line 168

Is this PHP5 being buggy? I need to run in 5 as I'm using simpleXML. In the 
bigger picture all I want to decode is XML attached files.

Kind Regards

Dave. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux