Hi @Anonymous ,you don't necessarily need to create an Office 365 or Microsoft 365 account for organizations to send emails with modern authentication. Azure Communication Services (ACS) allows you to send emails using Azure Communication Resource. You can configure email with two types of domains: Azure Managed Domains and Custom Domains.
Azure Managed Domains provide a one-click setup, and you can send emails using mail from domains like donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net
Custom Domains allow you to add a domain that you already own, verify the ownership, and configure the required authentication support.
To register users in Azure Active Directory, you can use the Microsoft Graph API or other partner-driven connectors. For C#, you can use the Microsoft Graph SDK to interact with the API and register users. Here's an example of how to create a user using the Microsoft Graph SDK in C#:
using Microsoft.Graph;
using Microsoft.Identity.Client;
// ...
public async Task CreateUserAsync()
{
var confidentialClientApplication = ConfidentialClientApplicationBuilder
.Create("<client-id>")
.WithTenantId("<tenant-id>")
.WithClientSecret("<client-secret>")
.Build();
var authProvider = new ClientCredentialProvider(confidentialClientApplication);
var graphClient = new GraphServiceClient(authProvider);
var user = new User
{
AccountEnabled = true,
DisplayName = "John Doe",
MailNickname = "johndoe",
UserPrincipalName = "johndoe@yourdomain.com",
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = true,
Password = "your-password"
}
};
await graphClient.Users
.Request()
.AddAsync(user);
Replace <client-id>
, <tenant-id>
, <client-secret>
, and other placeholders with your actual values. This example assumes you have the necessary permissions configured for your application in Azure AD.
Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James