blob: 3df81ea29de17ac1678e5acb1819f8401eb07f43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
--TEST--
Bug #40854 (imap_mail_compose() creates an invalid terminator for multipart e-mails)
--SKIPIF--
<?php
if (!extension_loaded("imap")) {
die("skip imap extension not available");
}
?>
--FILE--
<?php
$envelope["from"]= "joe@example.com";
$envelope["to"] = "foo@example.com";
$envelope["cc"] = "bar@example.com";
$part1["type"] = TYPEMULTIPART;
$part1["subtype"] = "mixed";
$part2["type"] = TYPEAPPLICATION;
$part2["encoding"] = ENCBINARY;
$part2["subtype"] = "octet-stream";
$part2["description"] = 'a.txt';
$part2["contents.data"] = '';
$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 imap_mail_compose($envelope, $body);
?>
--EXPECTF--
From: joe@example.com
To: foo@example.com
cc: bar@example.com
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
--%s
Content-Type: APPLICATION/octet-stream
Content-Transfer-Encoding: BASE64
Content-Description: a.txt
--%s
Content-Type: TEXT/plain; CHARSET=US-ASCII
Content-Description: description3
contents.data3
--%s--
|