imap_mail_compose()
| From: | RomAsm | Date: | Mon, 14 May 2001 13:52:59 +0000 |
| Subject: | imap_mail_compose() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-55163@lists.php.net to get a copy of this message | ||
Hi,
I have a code from www.php.net for imap_mail_compose():
<?php
$envelope["from"]="musone@afterfive.com";
$envelope["to"]="musone@darkstar";
$envelope["cc"]="musone@edgeglobal.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));
?>
Problem is, when I'm reading mail with attachment in Outlook Express 5.0,
content of filename is OK but name of filename is absent: (I think there
would be: basename($filename))
Please help me!
Thanx,
Roman