This is a sample .NET Framework 4.8 WinForms app to demonstrate how to wire-up non-SMTP email with Office365. Microsoft has examples for WPF and UWP, but not WinForms, hence the creation of this small app. I've created it, too, to show that it's possible to use an older .NET Framework 4.8 with Microsoft Graph.
- Register application with Azure
- Set the permissions in Azure to the desire scopes. In this case, you'll need to add "Mail.Send" and "Mail.ReadWrite" for Microsoft Graph to allow proper permissions for sending emails and attachments. Scopes will also need to be specified in the application itself (~line 29 in MailInfo.cs in the sample)
- Use the ClientId and TenantId from app registration on Azure in local application (Program.cs)
- Restore packages