On 25/05/25 4:34 pm, Aditya Garg wrote: > Apart from SMTP, Microsoft also provides a REST API, branded as > Microsoft Graph for sending mails. Upon testing a bit, I have > found a few benefits over SMTP. Firstly, SMTP servers of Microsoft > are kinda slow. On an average, initialising the SMTP server even > on a fast internet connection takes around 8-10 seconds with > send-email. Once initialised, subsequent messages sometimes also > face delays, taking around 3-5 seconds per message, and other > times they are sent almost instantaneously. Secondly, their SMTP > server does not respect the Message-ID specified by the user and > replaces it with their own generated string. > > Microsoft Graph API solves both these problems. It is extremely > fast, taking around 1 second to send a series of 5 patches, and > also respects the Message-ID specified by the user. > > After this patch, users can use the graph API by having their > config as: > > [sendemail] > useMSGraph = true > MSGraphUser = yourname@xxxxxxxxxxx > > The API requires an OAuth2.0 access token for authentication, and > users can either generate them manually, or use a credential helper Also, if someone is interested in testing, you can use a small credentialhelper for msgraph here: https://github.com/AdityaGarg8/git-credential-email/tree/msgraph