php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31666 imap_mail_compose doesn?t work properly
Submitted: 2005-01-23 09:44 UTC Modified: 2005-02-10 23:24 UTC
From: oscar at cibermonte dot com Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.3.10 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: oscar at cibermonte dot com
New email:
PHP Version: OS:

 

 [2005-01-23 09:44 UTC] oscar at cibermonte dot com
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"]= "joe@example.com";
$envelope["to"]  = "foo@example.com";
$envelope["cc"]  = "bar@example.com";

$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: joe@example.com
To: foo@example.com
cc: bar@example.com
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--

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-10 23:24 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 07:01:31 2024 UTC