xref: /PHP-8.1/ext/standard/tests/mail/bug66535.phpt (revision b5c7a83d)
1--TEST--
2Bug #66535: Extra newline if add_x_header and no additional headers are used
3--INI--
4sendmail_path={MAIL:mailBug66535.out}
5mail.add_x_header = On
6--FILE--
7<?php
8echo "*** Testing mail() : send email without additional headers ***\n";
9
10// Initialise all required variables
11$to = 'user@company.com';
12$subject = 'Test Subject';
13$message = 'A Message';
14
15$outFile = "mailBug66535.out";
16@unlink($outFile);
17
18var_dump( mail($to, $subject, $message) );
19echo file_get_contents($outFile);
20unlink($outFile);
21
22?>
23--EXPECTF--
24*** Testing mail() : send email without additional headers ***
25bool(true)
26To: user@company.com
27Subject: Test Subject
28X-PHP-Originating-Script: %d:bug66535.php
29
30A Message
31