xref: /php-src/ext/mbstring/tests/gh8086.phpt (revision 218a93b8)
1--TEST--
2GH-8086 (mb_send_mail() function not working correctly in PHP 8.x)
3--EXTENSIONS--
4mbstring
5--INI--
6sendmail_path={MAIL:{PWD}/gh8086.eml}
7mail.mixed_lf_and_crlf=on
8--FILE--
9<?php
10mb_internal_encoding("UTF-8");
11mb_language("uni");
12$to = "omittedvalidaddress@example.com";
13$subject = "test mail";
14$message = "body of testing php mail";
15$header["Mime-Version"] = "1.0";
16$header["Content-Type"] = "text/html; charset=UTF-8";
17$header["From"] = "omittedvalidaddress2@example.com";
18$header["X-Mailer"] = "PHP/" . phpversion();
19mb_send_mail($to, $subject, $message, $header);
20
21$stream = fopen(__DIR__ . "/gh8086.eml", "rb");
22$eml = stream_get_contents($stream);
23fclose($stream);
24var_dump(preg_match_all('/(?<!\r)\n/', $eml));
25?>
26--CLEAN--
27<?php
28@unlink(__DIR__ . "/gh8086.eml");
29?>
30--EXPECT--
31int(6)
32