array names for imap_mail_compose
| From: | Jiří HRADIL | Date: | Fri, 27 Oct 2000 15:43:42 +0000 |
| Subject: | array names for imap_mail_compose | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-22340@lists.php.net to get a copy of this message | ||
Where can I find names of all arrays used by function imap_mail_compose? I
tried use this code, but only type and subtype works fine. Specially, I need
header Content-Disposition.
//start
$subject="Test mail";
$envelope["from"]="name@domain.net";
$envelope["to"]="$to";
$envelope["cc"]="$cc";
$part1["type"]=TYPEMULTIPART;
$part1["subtype"]="mixed";
$body[1]=$part1;
$part2["type"]=TYPETEXT;
$part2["encoding"]=ENCBINARY;
$part2["subtype"]="plain";
$part2["description"]="description3";
$part2["contents.data"]="$form_text";
$body[2]=$part2;
$filename="c:\\php\\uploads\\test.jpg"
$fp=FOpen($filename,"r");
$contents=FRead($fp, FileSize($filename));
fclose($fp);
$part3["type"]=TYPEIMAGE; //works fine
$part3["encoding"]=ENCBINARY; //works fine
$part3["subtype"]="jpeg"; //works fine
$part3["description"]=basename($prilohy_add[$i]); //not appended
$part3["contents.data"]="$contents"; //works fine
$part3["disposition"]="attachment; filename=test.jpg"; //not
appended, what's wrong?
$body[3]=$part3;
//final mail completing
$message=imap_mail_compose($envelope,$body);
$pos=Strpos($message, "\r\n\r\n");
$header=SubStr($message,0,$pos+2);
$body=SubStr($message, $pos, StrLen($message)-$pos);
$send_mail=mail("name@domain.net", "$subject", "$body",
"$header"); /*I
must use first string To: , because header information from envelope doesn't
work...*/
//end
Thanx for your help...
Jirka Hradil