I'm trying to get mails using imap_sort. My email adresse contain a lot of related email box. Example: xxxx@gmail.com i'm applying imap_sort on is related to xxx@hotmail.com and is related to xxx@mydomain.com. The result i get is only for those related to xxx@gmail.com and not related to other accounts even the mail exist in my gmail acoount.
The code i'm using actually:
$result = imap_sort($mail,SORTSIZE ,0,SE_UID,$search_criteria);
foreach ($result as $key => $value) {
extract_mail($mail,$value);
}
$search_criteria contain is FROM an email and is TO an email. What i need actually is to extract all mail FROM and TO this mail even if the communication is between other accounts but exist in gmail with different alias.