php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

access shared mail

Open caalber999 opened this issue 3 years ago • 1 comments

How can I access shared emails in Outlook?

caalber999 avatar Jan 19 '22 21:01 caalber999

Hi @caalber999 , I'm not to familiar with outlook. Do you mean shared folders? Have you checked if they are listed if you dump var_dump($client->getFolders()) ? Perhaps their name or path are a bit strange.

Best regards,

Webklex avatar Feb 03 '22 16:02 Webklex

Hi, think he want's to access an shared mailbox. Im looking for that myself. In regular PHP imap you can connect to using the following connection string

{outlook.office365.com:993/imap/ssl/[email protected]/[email protected]}

Now you login using your personal account, but access and shared mailbox.

RickKock avatar Oct 06 '22 08:10 RickKock

Hi, i was struggling with the very same problem.

Create the access token on behalf of your regular user and then use the address of the shared mailbox to login.

$client = $cm->make([
  'host' => 'outlook.office365.com',
  'port' => 993,
  'encryption' => 'ssl',
  'validate_cert' => true,
  'username' => '[email protected],
  'password' => $password,
  'protocol' => 'imap',
  'authentication' => "oauth",
]);

grimmalbrecht avatar Oct 06 '22 18:10 grimmalbrecht

still it cant connect may email is [email protected]

ssekimuli avatar Jul 07 '23 12:07 ssekimuli