Skip to content

Sending emails from Azure Communication Service Email using SMTP and application credentials #1967

@biancahuluban

Description

@biancahuluban

Hello,
I am trying to send an email by using the scope https://communication.azure.com/.default and SmtpHostUrl = "smtp.azurecomm.net", but I receive at
client.Authenticate(oauth2); the error 535: 5.7.3 Authentication unsuccessful

Basically, I use the following Microsoft documentation and MailKit 4.14.1, but without success(I sent email using the same account with graph scope and Graph nuget, the application id and client secret are well defined, the scope on the application for Graph is SMTP.send email, only that we want to switch to MailKit because we need only to send emails):

https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/send-email-smtp/send-email-smtp-oauth
Azure application-client secret configuration with these settings:

Image

Did anyone have a successful implementation for sending emails with MailKit with Azure Communication Service SMTP and client credentials? I did not find any example except for the Microsoft one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question about how to do something

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions