{"id":15410690,"url":"https://github.com/damienbod/emailcalandarsclient","last_synced_at":"2026-03-04T00:05:09.864Z","repository":{"id":45426214,"uuid":"393084313","full_name":"damienbod/EmailCalandarsClient","owner":"damienbod","description":"Send emails with Microsoft Graph API from a Desktop APP, C# and Visual basic projects","archived":false,"fork":false,"pushed_at":"2021-12-15T21:04:31.000Z","size":985,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T07:11:23.321Z","etag":null,"topics":["graph-api","microsoft-graph-api","oauth2","oidc","ui","wpf"],"latest_commit_sha":null,"homepage":"https://damienbod.com/2021/08/09/send-emails-using-microsoft-graph-api-and-a-desktop-client/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damienbod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-05T15:03:56.000Z","updated_at":"2024-09-25T23:50:52.000Z","dependencies_parsed_at":"2022-09-19T05:00:53.696Z","dependency_job_id":null,"html_url":"https://github.com/damienbod/EmailCalandarsClient","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damienbod%2FEmailCalandarsClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damienbod%2FEmailCalandarsClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damienbod%2FEmailCalandarsClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damienbod%2FEmailCalandarsClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damienbod","download_url":"https://codeload.github.com/damienbod/EmailCalandarsClient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249677786,"owners_count":21309632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-api","microsoft-graph-api","oauth2","oidc","ui","wpf"],"created_at":"2024-10-01T16:45:51.390Z","updated_at":"2026-03-04T00:05:09.823Z","avatar_url":"https://github.com/damienbod.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph API Email, Presence, MailboxSettings, Calendar client\n\n[![.NET Core Desktop](https://github.com/damienbod/EmailCalandarsClient/actions/workflows/dotnet-desktop.yml/badge.svg)](https://github.com/damienbod/EmailCalandarsClient/actions/workflows/dotnet-desktop.yml)\n\n## Blogs\n\n[Send Emails using Microsoft Graph API and a desktop client](https://damienbod.com/2021/08/09/send-emails-using-microsoft-graph-api-and-a-desktop-client/)\n\n## History\n\n2021-12-14 Added more graph clients\n\n2021-12-13 Updated to .NET 6, added calendar events, UserMailbox settings client\n\n## Requirements\n\nTo send emails using Microsoft Graph API, you need to have an office license for the Azure Active Directory user which sends the email.\n\nYou can sign-in here to check this:\n\nhttps://www.office.com\n\n## Setup Azure App registration\n\nThe API permissions require the Graph delegated permissions.\n\n![azureAppRegistration_emailCalendar_01](https://github.com/damienbod/EmailCalandarsClient/blob/main/images/azureAppRegistration_emailCalendar_01.png)\n\n\n### Email client\n\nThe Azure App registration requires the Graph API delegated **Mail.Send** and the **Mail.ReadWrite** scopes.\n\n```xml\n  \u003cappSettings\u003e\n    \u003cadd key=\"AADInstance\" value=\"https://login.microsoftonline.com/{0}/v2.0\"/\u003e\n    \u003cadd key=\"Tenant\" value=\"--your-tenant--\"/\u003e\n    \u003cadd key=\"ClientId\" value=\"--your-client-id--\"/\u003e\n    \u003cadd key=\"Scope\" value=\"User.read Mail.Send Mail.ReadWrite\"/\u003e\n  \u003c/appSettings\u003e\n```\n\n### Presence client\n\nThe Azure App registration requires the Graph API delegated **User.Read.All** and **Presence.Read.All** scope.\n\n```xml\n  \u003cappSettings\u003e\n    \u003cadd key=\"AADInstance\" value=\"https://login.microsoftonline.com/{0}/v2.0\"/\u003e\n    \u003cadd key=\"Tenant\" value=\"--your-tenant--\"/\u003e\n    \u003cadd key=\"ClientId\" value=\"--your-client-id--\"/\u003e\n    \u003cadd key=\"Scope\" value=\"User.read User.Read.All Presence.Read.All\"/\u003e\n  \u003c/appSettings\u003e\n```\n\n### User Mailbox settings client\n\nThe Azure App registration requires the Graph API delegated **User.Read.All** **MailboxSettings.Read** scopes.\n\n```xml\n  \u003cappSettings\u003e\n    \u003cadd key=\"AADInstance\" value=\"https://login.microsoftonline.com/{0}/v2.0\"/\u003e\n    \u003cadd key=\"Tenant\" value=\"--your-tenant--\"/\u003e\n    \u003cadd key=\"ClientId\" value=\"--your-client-id--\"/\u003e\n    \u003cadd key=\"Scope\" value=\"User.read User.Read.All MailboxSettings.Read\"/\u003e\n  \u003c/appSettings\u003e\n```\n\n### Calendar client\n\nThe Azure App registration requires the Graph API delegated **User.Read.All** **Calendars.Read **Calendars.Read.Shared** scopes.\n\n```xml\n  \u003cappSettings\u003e\n    \u003cadd key=\"AADInstance\" value=\"https://login.microsoftonline.com/{0}/v2.0\"/\u003e\n    \u003cadd key=\"Tenant\" value=\"--your-tenant--\"/\u003e\n    \u003cadd key=\"ClientId\" value=\"--your-client-id--\"/\u003e\n    \u003cadd key=\"Scope\" value=\"User.read User.Read.All Calendars.Read Calendars.Read.Shared\"/\u003e\n  \u003c/appSettings\u003e\n```\n\n## Nuget packages\n\n```xml\n\u003cItemGroup\u003e\n  \u003cPackageReference Include=\"Microsoft.Identity.Client\" Version=\"4.39.0\" /\u003e\n  \u003cPackageReference Include=\"Microsoft.Graph\" Version=\"4.11.0\" /\u003e\n  \u003cPackageReference Include=\"Newtonsoft.Json\" Version=\"13.0.1\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\n## C# to Visual Basic\n\nI converted the project from C# to Visual Basic using the telerik tool:\n\nhttps://converter.telerik.com/\n\n## Links\n\nhttps://docs.microsoft.com/en-us/graph/outlook-send-mail-from-other-user\n\nhttps://stackoverflow.com/questions/43795846/graph-api-daemon-app-with-user-consent\n\nhttps://winsmarts.com/managed-identity-as-a-daemon-accessing-microsoft-graph-8d1bf87582b1\n\nhttps://cmatskas.com/create-a-net-core-deamon-app-that-calls-msgraph-with-a-certificate/\n\nhttps://docs.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0\u0026tabs=http\n\nhttps://docs.microsoft.com/en-us/answers/questions/43724/sending-emails-from-daemon-app-using-graph-api-on.html\n\nhttps://stackoverflow.com/questions/56110910/sending-email-with-microsoft-graph-api-work-account\n\nhttps://docs.microsoft.com/en-us/graph/sdks/choose-authentication-providers?tabs=CS#InteractiveProvider\n\nhttps://docs.microsoft.com/en-us/graph/api/cloudcommunications-getpresencesbyuserid?view=graph-rest-1.0\u0026tabs=csharp\n\nhttps://docs.microsoft.com/en-us/graph/api/user-get-mailboxsettings?view=graph-rest-1.0\u0026tabs=csharp\n\nhttps://docs.microsoft.com/en-us/graph/api/user-list-events?view=graph-rest-1.0\u0026tabs=csharp\n\n## More information\n\nFor more information see MSAL.NET's conceptual documentation:\n- [Quickstart: Register an application with the Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app)\n- [Quickstart: Configure a client application to access web APIs](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis)\n- [Recommended pattern to acquire a token in public client applications](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/AcquireTokenSilentAsync-using-a-cached-token#recommended-call-pattern-in-public-client-applications)\n- [Acquiring tokens interactively in public client applications](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Acquiring-tokens-interactively) \n- [Customizing Token cache serialization](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/token-cache-serialization)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamienbod%2Femailcalandarsclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamienbod%2Femailcalandarsclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamienbod%2Femailcalandarsclient/lists"}