Followed this steps and getting error below
Configure a TLS certificate-based connector to relay email through Microsoft 365 or Office 365
First, configure your device or application by entering the settings as described in the following table:
Expand table
|Device or application setting|Value|
| -------- | -------- |
|Server/smart host|Your MX endpoint, for example, yourdomain- com.mail.protection.outlook.com|
|Server/smart host|Your MX endpoint, for example, yourdomain- com.mail.protection.outlook.com|
|Port|Port 25|
|TLS/StartTLS|Must be enabled and only TLS 1.2 is supported|
|TLS Certificate CN (Common Name) or SAN (Subject Alternative Name)|The certificate which has CN or SAN that contains a domain name you've registered with your Office 365 organization.|
|Email address|This can be any email address.|
If you already have a connector that's configured to deliver messages from your on-premises organization to Microsoft 365 or Office 365 (for example, a hybrid environment), you probably don't need to create a dedicated connector for Microsoft 365 or Office 365 SMTP relay. To create or change a certificate-based connector, perform the following steps:
Sign in to Exchange admin center. For more information, see Exchange admin center in Exchange Online.
On the left navigation pane, select mail flow, select Connectors, and then do the following:
If there are no connectors, select + Add a connector.
If a connector already exists, select the connector, and then select the edit icon.
On the Select your mail flow scenario page, select the Your organization's email server radio button under Connection from.
Once you choose Your organization's email server from the Connection from drop-down, Office 365 is automatically chosen from the Connection to drop-down.
Enter the connector name and other information, and then select Next.
On the Authenticating sent email page, select the first option to use the subject name on the certificate of the sending server to authenticate with Office 365. The domain name in the option should match the CN or SAN in the certificate used by your server, device, or application.
Note
This domain must be the one that belongs to your organization, that is, this domain should be the one you've registered with Microsoft 365. For more information, see Add a domain to Microsoft 365.
For example, Contoso.com belongs to your organization, and it's part of the CN or SAN in the certificate that your service, device, or application uses to communicate with Microsoft 365. If there are multiple domains in the certificate (such as mail1.contoso.com, mail2.contoso.com, and so on), we recommend that the domain in the connector UI be *.contoso.com.
Existing hybrid customers who used the Hybrid Configuration Wizard to configure their connectors should check their existing connector to ensure that it uses *.contoso.com instead of mail.contoso.com or hostname.contoso.com. This domain verification is because mail.contoso.com and hostname.contoso.com may not be registered domains in Microsoft 365.
Error
The mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2024-01-30T20:48:11). Exception Message: Cannot send mails to mail server. (Mailbox unavailable. The server response was: 5.7.51 TenantInboundAttribution; There is a partner connector configured that matched the message's recipient domain. The connector had either the RestrictDomainsToIPAddresses or RestrictDomainsToCertificate set