Connecting Tech Pros Worldwide Forums | Help | Site Map

glibc detected in imap_mail_compose function

Rob
Guest
 
Posts: n/a
#1: Aug 25 '05
Hi
I am getting the error

*** glibc detected *** free(): invalid pointer: 0x083e20cc ***
Aborted

When I run the code

<?php

$envelope["from"]= "a@b.co.uk";
$envelope["to"] = "a@b.co.uk";

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

$filename = "/tmp/list.txt";
$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["disposition.type"]='attachment';
$part2["disposition"]=array('filename'=>basename($filename));
#$part2["custom_headers"] = Array("Content-disposition: attachment;
filename=".$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));

?>


The line of code that is causing the problem is

$part['disposition'] = array ('filename'=>'file.txt');



My set up is
- RHEL 4
- Apache 1.3.29
- PHP 4.3.4
- IMAP-2002d

Any ideas what is causing this problem?

Cheers
Rob


Closed Thread