How to Read/Send Email via azure free tier account and graph api services

Learning Developer 0 Reputation points
2024-02-05T14:02:38.8466667+00:00

We are creating an app where we can provide email services to user and user can schedule the email sending as well. For this we created a app on Microsoft Azure, Set up the permissions on App and added the users. I am writing JAVA proof of concept for this using msal4j and microsoft graph api. This is what I am doing. I have created free tier account in portal.azure.com and created app.

From Free tier account can I sendEmail or readEmail. I am using below code for it.

IAuthenticationProvider iAuthProvider = new TokenCredentialAuthProvider(clientSecretCredential());
        
GraphServiceClient
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,406 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Cogan 10,342 Reputation points MVP
    2024-02-05T14:33:14.4766667+00:00

    This indicates that the Tenant ID you are providing is not valid. Check that what you are providing matches the Tenant ID show on the Entra ID overview page for the tenant where you Entra ID App lives.


  2. CarlZhao-MSFT 40,226 Reputation points
    2024-02-07T02:38:06.1733333+00:00

    Hi @Learning Developer

    This is because your tenant lacks a valid Office 365 Business subscription. If you are trying to access business-level O365 services (such as Exchange Online, Outlook, Teams, etc.), then an Office 365 license will be required.

    Please follow this document to subscribe to an Office 365 license for your tenant or start a free trial. After that, you also need to grant the license to the target user you are reading/sending emails on behalf of, which will automatically assign an EXO mailbox to the target user.

    de2ca1b1-a817-4825-b13c-dcb988c029f7

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.