xref: /PHP-5.4/ext/standard/tests/mail/bug66535.phpt (revision eca13f79)
1--TEST--
2Bug #66535: Extra newline if add_x_header and no additional headers are used
3--INI--
4sendmail_path=tee mailBasic.out >/dev/null
5mail.add_x_header = On
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/* Prototype  : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
14 * Description: Send an email message
15 * Source code: ext/standard/mail.c
16 * Alias to functions:
17 */
18
19echo "*** Testing mail() : send email without additional headers ***\n";
20
21// Initialise all required variables
22$to = 'user@company.com';
23$subject = 'Test Subject';
24$message = 'A Message';
25
26$outFile = "mailBasic.out";
27@unlink($outFile);
28
29var_dump( mail($to, $subject, $message) );
30echo file_get_contents($outFile);
31unlink($outFile);
32
33?>
34===DONE===
35--EXPECTF--
36*** Testing mail() : send email without additional headers ***
37bool(true)
38To: user@company.com
39Subject: Test Subject
40X-PHP-Originating-Script: %d:bug66535.php
41
42A Message
43===DONE===
44