To use SMTP TLS direct send with Microsoft Office-365 or Exchange see:
  "Direct send or Connector" -  https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365
  and "Relay" - https://learn.microsoft.com/en-us/exchange/mail-flow/connectors/allow-anonymous-relay?view=exchserver-2019


To use Xfinity send to smtp.comcast.net with authorization and TLS.
If get an error message stating  "535 5.7.0 ...authentication rejected (LS)" 
then open your comcast.net email web browser, click the gear (settings) icon, Security,  Check all Third party access security"

Most email services such as Yahoo and Google no longer allow direct sending with or without TLS.  They require setting up an Oauth project instead. 

The EsdTest app can support Oauth, but since every email service is different, and constantly is changing their protocols, and is is difficult to set up, we do not support the Oauth feature free of charge.  Contact the EsdTest vendor for pricing to enable it.

Once it is enabled, the following is required:

To use Google OAUTH in your application, you must create a project in Google Developers Console.

    - Create your project at https://console.developers.google.com/project.
    - Select your project -> APIs & Services -> Dashboard -> Credentials;
     Set detail information for your project at OAuth consent screen.
     Credentials -> Create Credentials -> OAuth client ID -> Web application or Other (Desktop Application).
    It depends on your application type.

     Input a name for your application, input your current ASP/ASP.NET URL at Authorized redirect URIs,
    for example: http://localhost/gmailoauth/default.aspx. (Desktop Application doesn't require this step)
    Click "Create", you will get your client id and client secret.

     Enable Gmail API at "Library" -> Search "Gmail" and Enable Gmail API.
     Go to OAuth consent screen -> Edit App -> Google Api Scopes,
      add "https://mail.google.com/" scope (SMTP protocol)
      or "https://www.googleapis.com/auth/gmail.send" scope (Gmail RESTFul API protocol)

     If you used https://mail.google.com or https://www.googleapis.com/auth/gmail.send, email, profile scope, you should verify your application that is inroduced in cosent screen.
    If you don't verify your application, your application is limited by some conditions.

    You must apply for your client id and client secret, don't use the client id in the sample project, because it is limited now.
    If you got "This app isn't verified" information, please click "advanced" -> Go to ... for test.

 See the sections in  https://www.emailarchitect.net/easendmail/ex/b/20.aspx
 - Create project in Google Developers Console
 - OAuth consent screen
 - Create credentials (OAuth client id)
 - Enable Gmail API
 - Edit scopes
 - API scopes
 - Authorized Redirect URIs
 - and https://www.emailarchitect.net/easendmail/ex/b/21.aspx


Can test with InitGoogleSmtpProvider settings of
    clientId = "1072602369179-aru4rj97ateiho9rt4pf5i8l1r01mc16.apps.googleusercontent.com"
    clientSecret = "Lnw8r5FvfKFNS_CSEucbdIE-"


Can test with InitGoogleGmailApiProvider settings of
    clientId = "499737360376-iqv4l8v02085jourush1ughrf4k5d1k6.apps.googleusercontent.com"
    clientSecret = "hzfYFWlL0ZQT82xu1v_P3MTr"




To use Microsoft OAUTH in your application, you must create a project in https://portal.azure.com.

 Sign in to the Azure portal using either a work or school account or a personal Microsoft account.
 If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the Azure AD tenant that you want.
 In the left-hand navigation pane, select the Azure Active Directory service, and then select App registrations > New registration.

 When the Register an application page appears, enter your application's registration information:

 Name - Enter a meaningful application name that will be displayed to users of the app.
 Supported account types - Select which accounts you would like your application to support. Because we need to support all Office 365 and LIVE SDK (hotmail, outlook personal account)
select Accounts "in any organizational directory and personal Microsoft accounts"

 Redirect URI (optional) - Select the type of app you're building, Web or Public client (mobile & desktop), and then enter the redirect URI (or reply URL) for your application.

For web applications, provide the base URL of your app. For example, http://localhost:31544 might be the URL for a web app running on your local machine.
Users would use this URL to sign in to a web client application.
For public client applications, provide the URI used by Azure AD to return token responses. Enter a value specific to your application, such as myapp://auth.

Can test with InitMsOffice365Provider settings of
    clientId = "eccbabb2-3377-4265-85c1-ea2fb515f075"
    clientSecret = "QaR_RR:-5WqTY[nni9pdBr9xVybqrAu4"



InitMsGraphApiProvider
    clientId = "eccbabb2-3377-4265-85c1-ea2fb515f075"
    clientSecret = "QaR_RR:-5WqTY[nni9pdBr9xVybqrAu4"

InitMsOffice365SmtpProvider
    clientId = "eccbabb2-3377-4265-85c1-ea2fb515f075"
    clientSecret = "QaR_RR:-5WqTY[nni9pdBr9xVybqrAu4"


InitMsLiveProvider
    clientId = "eccbabb2-3377-4265-85c1-ea2fb515f075"
    clientSecret = "QaR_RR:-5WqTY[nni9pdBr9xVybqrAu4"






 When finished, select Register.

 Azure AD assigns a unique application (client) ID to your app, and you're taken to your application's Overview page.
 click "Certificates and secrets" -> "client secrets" and add a new client secret.
 Important: Please store "client secret" by yourself, because it is hidden when you view it at next time.

 API  Permission
 Click "API Permission"  -> "Add a permission" -> "Microsoft Graph" -> "Delegated Permission" -> "User.Read",
                         "email", "offline_access", "openid" and "profile", "SMTP.Send", "EWS.AccessAsUser.All"
To learn more detail, please refer to: 
         https://www.emailarchitect.net/easendmail/ex/b/22.aspx
         https://www.emailarchitect.net/easendmail/ex/b/23.aspx
 Authentication
 Click "Authentication" ->
    Implicit grant: check "Access tokens" and "ID tokens"
    Redirect URI: input the url to get authorization code, for native desktop application, you don't have to add redirect uri.

 Mobile and desktop applications: redirect Uri, please check the following URI.
   https://login.microsoftonline.com/common/oauth2/nativeclient
   https://login.microsoftonline.com/common/oauth2/nativeclient (LiveSDK)
   http://127.0.0.1 (local Http Listener)

 Supported account types: please select Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)

 Advanced settings: please set both "Live SDK Support" and "Treat application as a public client" to "Yes"

 Above client_id and secret support both "Office365 + EWS" and "Live (hotmail, outlook personal account) + Imap4", Office365 Oauth doesn't support IMAP4, only EWS is supported.

https://www.emailarchitect.net/easendmail/ex/b/22.aspx
https://www.emailarchitect.net/easendmail/ex/b/23.aspx
https://www.emailarchitect.net/easendmail/ex/b/24.aspx
