xref: /PHP-8.3/ext/mbstring/tests/bug52681.phpt (revision 51eec508)
1--TEST--
2Bug #52681 (mb_send_mail() appends an extra MIME-Version header)
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (!function_exists("mb_send_mail") || !mb_language("neutral")) {
8    die("skip mb_send_mail() not available");
9}
10?>
11--INI--
12sendmail_path={MAIL:{PWD}/bug52681.eml}
13mail.add_x_header=off
14--FILE--
15<?php
16$to = 'example@example.com';
17$headers = 'MIME-Version: 2.0';
18
19mb_send_mail($to, mb_language(), "test", $headers);
20
21readfile(__DIR__ . "/bug52681.eml");
22?>
23--CLEAN--
24<?php
25@unlink(__DIR__ . "/bug52681.eml");
26?>
27--EXPECTF--
28To: example@example.com
29Subject: %s
30MIME-Version: 2.0
31Content-Type: text/plain; charset=%s
32Content-Transfer-Encoding: %s
33
34%s
35