????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 216.73.216.86 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/standard/tests/mail/ |
Upload File : |
--TEST-- Test mail() function : basic functionality --SKIPIF-- <?php if( substr(PHP_OS, 0, 3) != 'WIN' ) { die('skip...Windows only test'); } require_once(dirname(__FILE__).'/mail_skipif.inc'); ?> --INI-- max_execution_time = 120 --FILE-- <?php /* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) * Description: Send an email message * Source code: ext/standard/mail.c * Alias to functions: */ error_reporting(E_ALL & ~E_STRICT); echo "*** Testing mail() : basic functionality ***\n"; require_once(dirname(__FILE__).'/mail_include.inc'); $subject_prefix = "!**PHPT**!"; $to = "$username"; $subject = "$subject_prefix: Basic PHPT test for mail() function"; $message = <<<HERE Description bool mail ( string \$to , string \$subject , string \$message [, string \$additional_headers [, string \$additional_parameters]] ) Send an email message HERE; $extra_headers = "from: user@example.com"; $res = mail($to, $subject, $message, $extra_headers); if ($res !== true) { exit("TEST FAILED : Unable to send test email\n"); } else { echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { // sleep for a while to allow msg to be delivered sleep(1); $current_msg_count = imap_check($imap_stream)->Nmsgs; // Iterate over recent msgs to find the one we sent above for ($i = 1; $i <= $current_msg_count; $i++) { // get hdr details $hdr = imap_headerinfo($imap_stream, $i); if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { echo "Id of msg just sent is $i\n"; echo ".. delete it\n"; imap_delete($imap_stream, $i); $found = true; break; } } $repeat_count -= 1; } if (!$found) { echo "TEST FAILED: email not delivered\n"; } else { echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); ?> ===Done=== --EXPECTF-- *** Testing mail() : basic functionality *** Msg sent OK Id of msg just sent is %d .. delete it TEST PASSED: Msgs sent and deleted OK ===Done===