\\
About OAUTH2 for authentication: [https://docs.microsoft.com/en-us/graph/auth-v2-user]\\
\\
!!!Microsoft Graph Application registration
\\
It requires Microsoft Graph Application registration. Start at the Microsoft azure portal:\\
[https://azure.microsoft.com/en-us/features/azure-portal/]\\
\\
__Application registration: __Go to the App registrations and click on New registration:\\
\\
\\
[attachments|new_registration.png]\\
\\
Name it. Select the Multitenant and personal Microsoft accounts type. The redirect url must ends with :register_microsoft_graph_api/. Then click on register.\\
\\
[attachments|register_app.png]
\\
Under the redirect url configuration enable the Access Token to be issued by the authorization endpoint:
\\ 
\\
__API permission :__ You also need to provide permission for the Microsoft Graph. Go to the Api permission. Click on Add permission, select Microsoft Graph. Choose Delegated permission and add the "
SMTP.Send" or/and "IMAP.AccessAsUser.All" permission:\\
\\
[attachments|permission_microsoft_graph.png]\\
[attachments|permission_final.png]\\
\\
__Client id : __ You can find it at Azure portal -> App Registration -> Overview:\\  
\\
[attachments|client_id.png]\\
\\
__Secret key :__ A new client secret needs to be created as well. Go to the "Certificate & secrets" and generate a new secret key. Click on New client secret:\\
\\
[attachments|new_secret.png]\\
\\
!!!SMTP settings\\
\\ 
Provide the smtp server used for emailing (for example : smtp.office365.com)\\
Click on Get Refresh Token button.\\
__In order to get the Refresh token, CrushFTP WebInterface's host and port number must match with the redirect url specified at Azure Application Registration.__\\
Put the Client Id and Secret (from Azure App Registration) and "common" for tenant input field.\\
\\
[attachments|smtp_get_refresh_token.png]\\
\\
Click on OK button, allow CrushFTP to have access to send Email. As the end of the result the SMTP Username and Password will filled the Client ID and the Refresh Token.\\
It is required to provide the from email address too.\\
\\ 
[attachments|smtp_from_email.png]\\
\\
!!!PopImapTask
\\
Provide the host and click on the Get Refresh Token button.\\
__In order to get the Refresh token, CrushFTP WebInterface's host and port number must match with the redirect url specified at Azure Application Registration.__\\
Because the email address is essential after you got the refresh token, the Mail Username input field needs to be modified.\\
Put your email address ended with tilde(~) in the beginning of the Mail Username input field.\\
\\
{{{
Mail Username : <<your email address>>~<<what was before>> 
}}}
\\
[attachments|pop_imap_task.png]\\
\\