From:             oscar at cibermonte dot com
Operating system: linux
PHP version:      4.3.10
PHP Bug Type:     IMAP related
Bug description:  imap_mail_compose doesn�t work properly

Description:
------------
The function imap_mail_compose doesn�t work as we wait. It doesn�t return
the MIME message, just the separator between parts of the MIME message. I
have tested in two different linux server provider and both have the same
problem. They have recompiled php for linux thinking that maybe they are
missed some library but the result is the same. Even one of them have
tried to fix a patch but the result is the same: the function is not
working properly.

Reproduce code:
---------------
<?php

/* This is the example code of the documentation of php */

$envelope["from"]= "[EMAIL PROTECTED]";
$envelope["to"]  = "[EMAIL PROTECTED]";
$envelope["cc"]  = "[EMAIL PROTECTED]";

$part1["type"] = TYPEMULTIPART;
$part1["subtype"] = "mixed";

$filename = "/tmp/imap.c.gz";
$fp = fopen($filename, "r");
$contents = fread($fp, filesize($filename));
fclose($fp);

$part2["type"] = TYPEAPPLICATION;
$part2["encoding"] = ENCBINARY;
$part2["subtype"] = "octet-stream";
$part2["description"] = basename($filename);
$part2["contents.data"] = $contents;

$part3["type"] = TYPETEXT;
$part3["subtype"] = "plain";
$part3["description"] = "description3";
$part3["contents.data"] = "contents.data3\n\n\n\t";

$body[1] = $part1;
$body[2] = $part2;
$body[3] = $part3;

echo nl2br(imap_mail_compose($envelope, $body));

?> 

Expected result:
----------------
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY="150-2734-1106469717=:2576"

--150-2734-1106469717=:2576
Content-Type: APPLICATION/octet-stream
Content-Transfer-Encoding: BASE64
Content-Description: 



--150-2734-1106469717=:2576
Content-Type: TEXT/plain; CHARSET=US-ASCII
Content-Description: description3

contents.data3



--150-2734-1106469717=:2576--


Actual result:
--------------
---1260887309-1804289383-1106469691=:22016--

-- 
Edit bug report at http://bugs.php.net/?id=31666&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31666&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31666&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31666&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31666&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31666&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31666&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31666&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31666&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31666&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31666&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31666&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31666&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31666&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31666&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31666&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31666&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31666&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31666&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31666&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31666&r=mysqlcfg

Reply via email to