I created a communication service in azure to send mail. Then I added a verified custom domain. However, when I send an email, I get an error like this;
RestError: The specified sender domain has not been linked.
I am able to send successfully with azure managed domain mail.
Here is my code:
const connectionString = `endpoint=https://*******`;
const client = new EmailClient(connectionString);
const emailMessage = {
sender: "noreply@****.com",
content: {
subject: "This is the subject",
plainText: "This is the body",
},
recipients: {
to: [
{
email: "*****",
displayName: "Test test",
},
],
},
};
const message = await client.send(emailMessage);
How can I solve this problem ?
2
Answers
You need to create an Email Communication Services (ECS) resource and connect it to your Azure Communication Services (ACS) resource before start sending emails. Please have a look at below documentations:
The problem has been resolved with Custome domain creation from Azure Active Directory.
https://learn.microsoft.com/en-us/azure/active-directory/fundamentals/add-custom-domain
Note: Add custome domain through Azure Communication Service is not providing MX record.
Where we can get TXT and MX record which need to be add records on our DNS service provider setting.
Reference
https://learn.microsoft.com/en-us/answers/questions/1183905/azure-communication-service-give-error-the-specifi?page=1&orderby=helpful