1--TEST--
2Test mail() function : basic functionality
3--SKIPIF--
4<?php
5if(substr(PHP_OS, 0, 3) == "WIN")
6  die("skip Won't run on Windows");
7?>
8--INI--
9sendmail_path="sed > /tmp/php_test_mailBasic2.out"
10mail.add_x_header = Off
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() : basic functionality ***\n";
20
21
22// Initialise all required variables
23$to = 'user@company.com';
24$subject = 'Test Subject';
25$message = 'A Message';
26$additional_headers = 'KHeaders';
27$additional_parameters = "-e '5 a--- Extras'";
28$outFile = "/tmp/php_test_mailBasic2.out";
29@unlink($outFile);
30
31echo "-- extra parameters --\n";
32// Calling mail() with all possible arguments
33var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) );
34
35echo file_get_contents($outFile);
36unlink($outFile);
37?>
38===DONE===
39--EXPECT--
40*** Testing mail() : basic functionality ***
41-- extra parameters --
42bool(true)
43To: user@company.com
44Subject: Test Subject
45KHeaders
46
47A Message
48--- Extras
49===DONE===
50