I need your help in one of my project requirement.
My requirement is to send mail from our .net Application. So when user want to send mail then first the user should be redirected to the microsoft sign-in page (e.g https://login.microsoftonline.com/login.srf ) where the user can enter the corporate credential and from there after successful login it should return a token. Then from that token we need to retrieve the user's mailid.
Then we can pass that mailid along with the Token to generate the oAuth object and then authenicate that Oauth object and then after successful authentication we can send mail.
Below links are giving me some idea but I am not sure how to redirect user to sign-in page and after successful sign-in how to capture the Token.
https://github.com/jstedfast/MailKit/blob/master/ExchangeOAuth2.md
Any kind help is greatly appreciated. Any sample code will be of great help.