Home > Software design >  Azure communication service email sending error
Azure communication service email sending error

Time:01-16

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 ?

CodePudding user response:

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:

  • Related