1--TEST--
2Test mail() function : basic functionality
3--INI--
4sendmail_path={MAIL:mailBasic.out}
5mail.add_x_header = Off
6--FILE--
7<?php
8echo "*** Testing mail() : basic functionality ***\n";
9
10
11// Initialise all required variables
12$to = 'user@example.com';
13$subject = 'Test Subject';
14$message = 'A Message';
15$additional_headers = 'KHeaders';
16$outFile = "mailBasic.out";
17@unlink($outFile);
18
19echo "-- All Mail Content Parameters --\n";
20// Calling mail() with all additional headers
21var_dump( mail($to, $subject, $message, $additional_headers) );
22echo file_get_contents($outFile);
23unlink($outFile);
24
25echo "\n-- Mandatory Parameters --\n";
26// Calling mail() with mandatory arguments
27var_dump( mail($to, $subject, $message) );
28echo file_get_contents($outFile);
29unlink($outFile);
30
31?>
32--EXPECT--
33*** Testing mail() : basic functionality ***
34-- All Mail Content Parameters --
35bool(true)
36To: user@example.com
37Subject: Test Subject
38KHeaders
39
40A Message
41
42-- Mandatory Parameters --
43bool(true)
44To: user@example.com
45Subject: Test Subject
46
47A Message
48