1

I'm working on an email trigger component where I have been able to successfully use client_credentials flow with Microsoft graph API.

However I want to be able to use spring email and bring in benefits it provides over a rest api call to the Microsoft graph API, things like using thymeleaf email templates for decorating the emails.

I tried doing that by first getting the token from Microsoft graph and use it as the password for the JavaMailSender instance and by using host as smtp.office365.com but it didn't work. I followed this link for that experiment JavaMail connecting to Office 365 XOAUTH2 for IMAP Authentication fails

Is there an easy way to do this? I want to basically get the best of both worlds, spring email and Microsoft graph API

  • 1
    Trying to get best of the world is ok, but lets get back to the reality. (1) Make sure that the email templates are compatible with Microsoft Outlook (checkout the HTML tags/contents). (2) In case if you have template with you of Spring email, copy the body content in the message that you're building and send it out using Microsoft Graph API. – Dev Mar 25 '21 at 16:06

0 Answers0