xref: /PHP-7.4/ext/standard/tests/mail/bug51604.phpt (revision 9adfcea2)
1--TEST--
2Bug #51604 (newline in end of header is shown in start of message)
3--INI--
4sendmail_path=tee mail_bug51604.out >/dev/null
5mail.add_x_header = Off
6--SKIPIF--
7<?php
8if(substr(PHP_OS, 0, 3) == "WIN")
9  die("skip Won't run on Windows");
10?>
11--FILE--
12<?php
13// Initialise all required variables
14$to = 'user@example.com';
15$subject = 'Test Subject';
16$message = 'A Message';
17$additional_headers = "KHeaders\n\n\n\n\n";
18$outFile = "mail_bug51604.out";
19@unlink($outFile);
20
21// Calling mail() with all additional headers
22var_dump( mail($to, $subject, $message, $additional_headers) );
23echo file_get_contents($outFile);
24unlink($outFile);
25
26?>
27===DONE===
28--EXPECT--
29bool(true)
30To: user@example.com
31Subject: Test Subject
32KHeaders
33
34A Message
35===DONE===
36