'Read email and get attachments from Office 365 mailbox with Laravel

I'm looking for the best solution to read emails and get attachments from Office 365 mailbox to save them on my Laravel application.

I've tried Laravel IMAP https://github.com/Webklex/laravel-imap but it seems doesn't can connect: "Connection failed".

This is my setup on .env file:

IMAP_HOST=outlook.office365.com 
IMAP_PORT=993
IMAP_ENCRYPTION=tls
IMAP_VALIDATE_CERT=true
[email protected]
IMAP_PASSWORD=MyPassword
IMAP_DEFAULT_ACCOUNT=default
IMAP_PROTOCOL=imap


Solution 1:[1]

I finally solved using Microsoft Graph.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Roberto Remondini