Send Mail Using OAuth 2.0

Send Mail Using Microsoft GraphAPI is a feature allowing users to programmatically send email messages using the Microsoft Graph API. The API will then authenticate the request, create the email message, and send it to the specified recipient. 

Microsoft GraphAPI is added as an API type in the SMTP configuration screen page in the application. The option enables users to send mail using OAuth 2.0.

Benefits 

  • Notably faster in comparison to SMTP (Simple Mail Transfer Protocol) for communication and data exchange. 

  • Effectively manages requests and responses. 

  • Offers optimized integration with a range of Microsoft services. 

Configure API type for sending mail 

This section contains the list of steps for configuring Send Mail Using Microsoft GraphAPI

Prerequisites: 

  1. Add the value Microsoft GraphAPI in Common Master in Master Type as SMTPAPITypes along with SendGrid. 
     
  2. Add the following key in Web.config file -  

          <add key="Mail:SaveSentToItems" value="true" /> 

       This is default key for Microsoft GraphAPI configuration. 

 

The keys needed for Microsoft Graph API at configuration level are listed below: 

       <add key="GraphMail:TenantId" value="" /> 

     <add key="GraphMail:ClientId" value="" /> 

     <add key="GraphMail:ClientSecret" value="" /> 

To configure the API type, perform the following steps:

  1. Log in to the Application.

  2. Under the Admin module, select the SMTP configuration.

  3. Enter the values under Configuration Type, Tenant, From Name and From E-mail ID under the DETAILS.

    • Primary and Secondary configuration is not required for Microsoft GraphAPI.
    • Specify the first block of configuration details under SMTP configuration.


    Figure: SMTP configuration

  4. Select API type as Microsoft GraphAPI, from the drop-down list.

    Figure: Microsoft GraphAPI

  5. Specify the field values for Microsoft GraphAPI. Check Active to make the API Type as active.

    Figure: API Type

  6. Click SUBMIT Ito save the configuration.

  7. Navigate to SHOWLIST to view the saved API details. The saved API details are displayed in the grid format under LIST page as shown below.

    Figure: API details