Reading messages from Outlook Account

Asad Hashmi 6 Reputation points
2022-12-26T11:45:51.427+00:00

I need to use modern authentication (using OAUTH2) for reading the inbox messages using IMAP(in PHP). I am able to send emails using oauth2 but for reading emails. I can get the user's information using Graph API but cannot read the inbox messages. It is saying as "No Authenticate failed".

Is it necessary that we have to use an organizational/paid account to hit the email's read api?

Microsoft 365 and Office | Development | Microsoft 365 Publishing
Microsoft Security | Microsoft Graph
{count} vote

1 answer

Sort by: Most helpful
  1. Adeel Ahmed 0 Reputation points
    2023-01-17T08:41:02.3466667+00:00

    Hi Asad,

    I hope you are doing well.

    I am also using imap_open on PHP but using Basic Auth and running out of time to shift it to Modern Auth.

    Can you please help me out and explain how you created the app and its settings and how you allowed user to use the application?

    Also, do you run the php script as a cron job?

    I would highly appreciate if you could help me out.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.