> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Communication Servicesを外部SMTPメールプロバイダーとして構成する

> Azure Communication Servicesをメールプロバイダーとして構成する方法について説明します。

<Card title="始める前に">
  * Auth0からSMTPプロバイダーにメールが送信されるように、テナントを構成します。

  1. ポートを開いて、Auth0からAzure Communication Servicesへのインバウンドトラフィックを許可します。
  2. [［Dashboard ］>［Branding（ブランディング）］>［Email Provider（メールプロバイダー）］](https://manage.auth0.com/#/branding/email_provider)に移動します。
  3. IPのリストを更新します。詳細については、「[許可リスト用のAuth0 IPアドレス](/docs/ja-jp/secure/security-guidance/data-security/allowlist)

  * 有効なサブスクリプションのある[Microsoft Azure](https://azure.microsoft.com/)アカウントを作成します。
</Card>

Auth0では独自のSMTPメールプロバイダーを構成して、メール通信をより完全に管理、監視、トラブルシューティングできるようにすることができます。Auth0に組み込みのメールインフラストラクチャは、メールのテストにのみ使用してください。

## Azure Communication Servicesを構成する

1. [Microsoft Azure](https://azure.microsoft.com/)アカウントにログインします。
2. 既存のリソースがない場合には、[Communication Services](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/create-communication-resource?tabs=windows\&pivots=platform-azp#create-azure-communication-services-resource)のリソースを作成します。
3. 検索バーに「Communication Services」と入力します。
4. **［Create（作成）］** を選択します。
5. **［ツール］** 設定の **［キー］** を選択します。使用しているCommunication Servicesの[接続文字列](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/create-communication-resource?tabs=windows\&pivots=platform-azp#create-azure-communication-services-resource)を取得します。
6. **［主キー］** にある **［接続文字列］** の値をコピーします。

   1. 有効な接続文字列の形式は`endpoint={commuication services url};accesskey={access key}`です。
7. 接続文字列の値をコピーしたまま、[［Auth0 Dashboard］>［Branding（ブランディング）］>［Email Provider（メールプロバイダー）］](https://manage.auth0.com/#/branding/email_provider)に移動します。
8. **［Use my own email provider（独自のメールプロバイダーを使用する）］** を選択します。
9. **［Azure Communication Services］** を選択します。
10. 以下を行って、構成を完了させます。

    1. **［From（差出人）］** のメールアドレスを入力します。
    2. Azure Communication Servicesの **接続文字列** を追加します。
    3. **［Save（保存）］** を選択します。

## テストメールを送信する

**［Send Test Email（テストメールを送信）］** ボタンを使用して、テストメールを送信します。すべてが正しく構成されていると、確認メールを受け取ります。

数分経ってもメールを受信しない場合は、[Auth0ログ](https://manage.auth0.com/#/logs)でエラーコードを確認してください。Communication Servicesの[［Metrics Monitor（メトリック監視）］](https://learn.microsoft.com/en-us/azure/communication-services/concepts/metrics#chat-api-request-metric-operations)ページに、ユーザーに送信したすべてのメールの配信インサイトが表示されるようになります。
