xref: /PHP-8.1/ext/standard/tests/mail/bug51604.phpt (revision f1e00033)
1--TEST--
2Bug #51604 (newline in end of header is shown in start of message)
3--INI--
4sendmail_path={MAIL:mail_bug51604.out}
5mail.add_x_header = Off
6--FILE--
7<?php
8// Initialise all required variables
9$to = 'user@example.com';
10$subject = 'Test Subject';
11$message = 'A Message';
12$additional_headers = "KHeaders\n\n\n\n\n";
13$outFile = "mail_bug51604.out";
14@unlink($outFile);
15
16// Calling mail() with all additional headers
17var_dump( mail($to, $subject, $message, $additional_headers) );
18echo file_get_contents($outFile);
19unlink($outFile);
20
21?>
22--EXPECT--
23bool(true)
24To: user@example.com
25Subject: Test Subject
26KHeaders
27
28A Message
29