bug31142_1.phpt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. Bug #31142 test #1 (imap_mail_compose() generates incorrect output)
  3. --EXTENSIONS--
  4. imap
  5. --FILE--
  6. <?php
  7. $envelope["from"]= "joe@example.com";
  8. $envelope["to"] = "foo@example.com";
  9. $envelope["cc"] = "bar@example.com";
  10. $part1["type"] = TYPEMULTIPART;
  11. $part1["subtype"] = "mixed";
  12. $part2["type"] = TYPEAPPLICATION;
  13. $part2["encoding"] = ENCBINARY;
  14. $part2["subtype"] = "octet-stream";
  15. $part2["description"] = "some file";
  16. $part2["contents.data"] = "ABC";
  17. $part3["type"] = TYPETEXT;
  18. $part3["subtype"] = "plain";
  19. $part3["description"] = "description3";
  20. $part3["contents.data"] = "contents.data3\n\n\n\t";
  21. $body[1] = $part1;
  22. $body[2] = $part2;
  23. $body[3] = $part3;
  24. echo imap_mail_compose($envelope, $body);
  25. ?>
  26. --EXPECTF--
  27. From: joe@example.com
  28. To: foo@example.com
  29. cc: bar@example.com
  30. MIME-Version: 1.0
  31. Content-Type: MULTIPART/mixed; BOUNDARY="%s"
  32. --%s
  33. Content-Type: APPLICATION/octet-stream
  34. Content-Transfer-Encoding: BASE64
  35. Content-Description: some file
  36. QUJD
  37. --%s
  38. Content-Type: TEXT/plain; CHARSET=US-ASCII
  39. Content-Description: description3
  40. contents.data3
  41. --%s--