I am trying to replace a windows service which sends emails for users via smtp with Microsoft accounts (within the business)
Microsoft are turning off the old auth method at the end of the month
I am using c# and mail kit and can get a token, however I can not currently send emails without user interaction to 'sign in via a webpage' each time to grant permission
Ofcourse a windows service on another box can not interact with the users
I have registered my app via azure, that part seems done
I have searched the web and find a lot of mixed results
Is anyone aware, Is it currently possible to have a windows service (without user interaction) send emails on a users behalf (I have their user/pass etc) but can not see a clear way to do this using mailkit
Thank You
it appears that user:sendmail has application permission. https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http
meaning you can register your application with a client secret and then use the client secret to make calls to graph without the need for user interaction.
you can most of this from the graph quick start https://developer.microsoft.com/en-us/graph/quick-start
I am working on something similar where I am making graph calls through a c# api but probably similiar.
I have my registration info in appsettings.
I have a helper class that makes the api calls (this one is getting some users)
then I can make calls to it like this