2 Test imap_body() function : basic functionality
5 require_once(dirname(__FILE__).'/skipif.inc');
9 /* Prototype : string imap_body ( resource $imap_stream , int $msg_number [, int $options ] )
10 * Description: Read the message body.
11 * Source code: ext/imap/php_imap.c
14 echo "*** Testing imap_body() : basic functionality ***\n";
16 require_once(dirname(__FILE__).'/imap_include.inc');
18 echo "Create a new mailbox for test\n";
19 $imap_stream = setup_test_mailbox("", 1);
20 if (!is_resource($imap_stream)) {
21 exit("TEST FAILED: Unable to create test mailbox\n");
24 $check = imap_check($imap_stream);
25 echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
27 // show body for msg 1
28 var_dump(imap_body($imap_stream, 1));
31 var_dump(imap_body($imap_stream, 1, FT_UID));
33 imap_close($imap_stream);
38 require_once('clean.inc');
41 *** Testing imap_body() : basic functionality ***
42 Create a new mailbox for test
43 Create a temporary mailbox and add 1 msgs
44 .. mailbox '%s' created
45 Msg Count in new mailbox: 1
46 %unicode|string%(%d) "1: this is a test message, please ignore%a"
47 %unicode|string%(%d) "1: this is a test message, please ignore%a"