mb_send_mail05.phpt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. mb_send_mail() test 5 (lang=Simplified Chinese)
  3. --EXTENSIONS--
  4. mbstring
  5. --SKIPIF--
  6. <?php
  7. if (substr(PHP_OS, 0, 3) == 'WIN') {
  8. die('skip.. Not valid for Windows');
  9. }
  10. if (!function_exists("mb_send_mail") || !mb_language("Simplified Chinese")) {
  11. die("skip mb_send_mail() not available");
  12. }
  13. if (!@mb_internal_encoding('GB2312')) {
  14. die("skip GB2312 encoding is not available on this platform");
  15. }
  16. ?>
  17. --INI--
  18. sendmail_path=/bin/cat
  19. mail.add_x_header=off
  20. --FILE--
  21. <?php
  22. $to = 'example@example.com';
  23. /* default setting */
  24. mb_send_mail($to, mb_language(), "test");
  25. /* Simplified Chinese (HK-GB-2312) */
  26. if (mb_language("simplified chinese")) {
  27. mb_internal_encoding('GB2312');
  28. mb_send_mail($to, "²âÑé ".mb_language(), "²âÑé");
  29. }
  30. ?>
  31. --EXPECTF--
  32. To: example@example.com
  33. Subject: %s
  34. MIME-Version: 1.0
  35. Content-Type: text/plain; charset=%s
  36. Content-Transfer-Encoding: %s
  37. %s
  38. To: example@example.com
  39. Subject: =?HZ-GB-2312?B?fnsyYlFpfn0gU2ltcGxpZmllZCBD?=
  40. =?HZ-GB-2312?B?aGluZXNl?=
  41. MIME-Version: 1.0
  42. Content-Type: text/plain; charset=HZ-GB-2312
  43. Content-Transfer-Encoding: 7bit
  44. ~{2bQi~}