// 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 ***
Warning: mail(): Failed to connect to mailserver at "localhost" port 2525, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in %s on line %d