mb_send_mail05.phpt 1.0 KB

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