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="cat > /tmp/php_test_mailBasic2.out" 10mail.add_x_header = Off 11--FILE-- 12<?php 13echo "*** Testing mail() : basic functionality ***\n"; 14 15 16// Initialise all required variables 17$to = 'user@example.com'; 18$subject = 'Test Subject'; 19$message = 'A Message'; 20$additional_headers = 'KHeaders'; 21$additional_parameters = "-n"; 22$outFile = "/tmp/php_test_mailBasic2.out"; 23@unlink($outFile); 24 25echo "-- extra parameters --\n"; 26// Calling mail() with all possible arguments 27var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) ); 28 29echo file_get_contents($outFile); 30unlink($outFile); 31?> 32--EXPECTF-- 33*** Testing mail() : basic functionality *** 34-- extra parameters -- 35bool(true) 36%w1%wTo: user@example.com 37%w2%wSubject: Test Subject 38%w3%wKHeaders 39%w4%w 40%w5%wA Message 41