2 Bug #35669 (imap_mail_compose() crashes with multipart-multiboundary-email)
5 if (!extension_loaded("imap")) {
6 die("skip imap extension not available");
11 $envelope["from"] = 'Santa <somewhere@northpole.gov>';
12 $envelope["to"] = 'The bad smurf <bad@smurf.com>';
13 $envelope['date'] = 'Wed, 04 Jan 2006 19:24:43 -0500';
15 $multipart["type"] = TYPEMULTIPART;
16 $multipart["subtype"] = "MIXED";
17 $body[] = $multipart; //add multipart stuff
19 $textpart["type"] = TYPEMULTIPART;
20 $textpart["subtype"] = "ALTERNATIVE";
21 $body[] = $textpart; //add body part
23 $plain["type"] = TYPETEXT;
24 $plain["subtype"] = "PLAIN";
25 $plain["charset"] = "iso-8859-1";
26 $plain["encoding"] = ENCQUOTEDPRINTABLE;
27 $plain["description"] = "Plaintype part of message";
28 $plain['disposition'] = "inline";
29 $plain["contents.data"] = 'See mom, it will crash';
31 $body[] = $plain; //next add plain text part
33 $html["type"] = TYPETEXT;
34 $html["subtype"] = "HTML";
35 $html["charset"] = "iso-8859-1";
36 $html["encoding"] = ENCQUOTEDPRINTABLE;
37 $html["description"] = "HTML part of message";
38 $html['disposition'] = "inline";
39 $html["contents.data"] = 'See mom, it will <b>crash</b>';
43 echo imap_mail_compose($envelope, $body);
46 Date: Wed, 04 Jan 2006 19:24:43 -0500
47 From: Santa <somewhere@northpole.gov>
48 To: The bad smurf <bad@smurf.com>
50 Content-Type: MULTIPART/MIXED; BOUNDARY="%s"
53 Content-Type: TEXT/ALTERNATIVE; CHARSET=US-ASCII
57 Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1
58 Content-Transfer-Encoding: QUOTED-PRINTABLE
59 Content-Description: Plaintype part of message
61 See mom, it will crash
63 Content-Type: TEXT/HTML; CHARSET=iso-8859-1
64 Content-Transfer-Encoding: QUOTED-PRINTABLE
65 Content-Description: HTML part of message
67 See mom, it will <b>crash</b>