php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65974 Unable to fetch emails from exchange server using imap
Submitted: 2013-10-27 08:18 UTC Modified: 2020-10-25 04:22 UTC
Votes:8
Avg. Score:4.5 ± 0.7
Reproduced:7 of 8 (87.5%)
Same Version:4 (57.1%)
Same OS:7 (100.0%)
From: anchal56 dot er at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: IMAP related
PHP Version: Irrelevant OS: LINUX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: anchal56 dot er at gmail dot com
New email:
PHP Version: OS:

 

 [2013-10-27 08:18 UTC] anchal56 dot er at gmail dot com
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);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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
Is this still an issue with any of the actively supported PHP
versions[1]?  If so, please update the PHP Version field (the
version is certainly not irrelevant).
 [2020-10-25 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC