Annotation of embedaddon/php/ext/standard/tests/mail/mail_basic2.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test mail() function : basic functionality
3: --SKIPIF--
4: <?php
5: if(substr(PHP_OS, 0, 3) == "WIN")
6: die("skip Won't run on Windows");
7: ?>
8: --INI--
1.1.1.2 ! misho 9: sendmail_path="cat > /tmp/php_test_mailBasic2.out"
1.1 misho 10: mail.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:
19: echo "*** 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';
1.1.1.2 ! misho 27: $additional_parameters = "-n";
1.1 misho 28: $outFile = "/tmp/php_test_mailBasic2.out";
29: @unlink($outFile);
30:
31: echo "-- extra parameters --\n";
32: // Calling mail() with all possible arguments
33: var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) );
34:
35: echo file_get_contents($outFile);
36: unlink($outFile);
37: ?>
38: ===DONE===
1.1.1.2 ! misho 39: --EXPECTF--
1.1 misho 40: *** Testing mail() : basic functionality ***
41: -- extra parameters --
42: bool(true)
1.1.1.2 ! misho 43: %w1%wTo: user@company.com
! 44: %w2%wSubject: Test Subject
! 45: %w3%wKHeaders
! 46: %w4%w
! 47: %w5%wA Message
1.1 misho 48: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>