|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-10-16 13:58 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2020-10-16 13:58 UTC] cmb@php.net
[2020-10-16 14:00 UTC] cmb@php.net
[2020-10-25 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
Description: ------------ I am using PHP IMAP tools to fetch the emails from various email server. My code works for various email server like gmail, ymail etc, but when it comes to exchange server, I am able to make a hit on the exchange server but can't be able to fetch the mails from exchange server. I used various php header like unseen/ALL etc but still i am not able to fetch the emails, instead I get only true as a response. Test script: --------------- if(strcmp($m_serv,'w2010ExchangeServer')==0 OR strcmp($m_serv,'w2003ExchangeServer')==0) { // die('Could not write to file in exchange'); $str = "{".$m_serv.":".$m_port."/imap/ssl}".$m_folder; $m_mail = imap_open($str , $m_username, $m_password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI')) or die("ERROR : " . imap_last_error()); // pop is 993 } else { // die('Could not write to file'); $m_mail = imap_open ($str, $m_username, $m_password) or die("ERROR : " . imap_last_error()); } $m_gunixtp = array(2592000, 1209600, 604800, 259200, 86400, 21600, 3600); //$m_gdmy = date('d-M-Y', time() - $m_gunixtp[$m_t]); //$m_gdmy = date ( "d M Y", strToTime ( "-7 days" ) ); //$m_search=imap_search ($m_mail, 'UNSEEN SINCE ' . $m_gdmy . ''); //$m_search=imap_search ($m_mail, 'UNSEEN SINCE '.$m_gdmy.''); //$m_search=imap_search ($m_mail, 'UNSEEN'); //$mc="UNSEEN TO ".$m_username; $mc="UNSEEN"; $myFile = 'test.txt'; $fh = fopen($myFile, 'a+') or die("t open file"); //$stringData = $m_search; fwrite($fh, $mc); fclose($fh); $m_search=imap_search ($m_mail, $mc);