(PHP3 >= 3.0.5, PHP4 )
imap_mail_compose --
Create a MIME message based on given envelope and body sections
Description
string imap_mail_compose
(array envelope, array body)
Példa 1. imap_mail_compose() example 1
2 <?php
3
4 $envelope["from"]="musone@afterfive.com";
5 $envelope["to"]="musone@darkstar";
6 $envelope["cc"]="musone@edgeglobal.com";
7
8 $part1["type"]=TYPEMULTIPART;
9 $part1["subtype"]="mixed";
10
11 $filename="/tmp/imap.c.gz";
12 $fp=fopen($filename,"r");
13 $contents=fread($fp,filesize($filename));
14 fclose($fp);
15
16 $part2["type"]=TYPEAPPLICATION;
17 $part2["encoding"]=ENCBINARY;
18 $part2["subtype"]="octet-stream";
19 $part2["description"]=basename($filename);
20 $part2["contents.data"]=$contents;
21
22 $part3["type"]=TYPETEXT;
23 $part3["subtype"]="plain";
24 $part3["description"]="description3";
25 $part3["contents.data"]="contents.data3\n\n\n\t";
26
27 $body[1]=$part1;
28 $body[2]=$part2;
29 $body[3]=$part3;
30
31 echo nl2br(imap_mail_compose($envelope,$body));
32
33 ?>
34 |
|