An Email Client to Send and Receive Emails from your Office 365 Account.
This application never stores user's credentials.
Mail champ solution consists of 3 Visual Studio Projects.
- Class Library
- Console Application
- WPF Application.
This is a reusable library built using .Net Framework 4.7.
- EmailSender - A Class to Send the email by setting Email Object
- EmailReader - A Class to read all the email as pet the Email Object Properties. Currently supports Inbox only.
- ExchangeServiceUtil - A Class which connects to EWS API with a given token.
This is a sample console application to demonstrate the capability of the Class Library.
This application has been designed to enable login to Microsoft account using Oauth and using explicit credentials.
The Program asks user to login to his Office 365 account (a popup window opens), User enters his credentials and
only token is passed back to our application from Microsoft.
Same Token is used to fetch Mails from User's Inbox or to Send Emails via EWS.
If the user decides to cancel the Office login window, application falls back to explicit credentials.
Application now asks the user to enter email and password in the console. Credentials are never stored on the server. They are only used for transacting with EWS and is automatically destroyed once the program ends.
This is also a sample application to demonstrate the reusability of Class library.
This application uses WPF.Net to show Inbox data on a GUI. This application only supports login via Oauth and also has a feature to cache the retrieved token and fetch a new token silently when the old token expires.
This can be run only on Windows machine as this was built using .Net Framework 4.7. Machine must have this version of .Net installed.
For running via Implicit login
- Prior to opening the solution, Make sure you have set the ClientId and TenantId in your Environment. Get the ClientID from your Office 365 account Azure portal (You must be the administrator for your org account).
- If you are a developer, Get a developer account from - https://developer.microsoft.com/en-us/microsoft-365/dev-program. Register the app in the Azure portal using the same developer account (Use org admin account) to get the Client Id and Tenant ID.
- More Info: https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/get-started-with-ews-managed-api-client-applications
- ENV Variables must be set as below
AZ_ClientID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (From Azure Portal)
AZ_TenantId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX (From Azure Portal or you can set it to "common")
For Explicit Login
WPF currently doesn't support this feature yet! You have to enter your EmailID and Password in the console after cancelling the Microsoft Login Popup.
Open the MailChamp.sln solution file in Visual Studio 2019.
Build the application.
Nugets are restored automatically during the build.
You can set either the Console App or the WPF as a startup project.
Press F5 to Run the application