빠른 시작: 관리 클라이언트 라이브러리를 사용하여 Azure Communication Services에서 도메인 제거 목록 관리
Important
이 문서에 설명된 기능은 현재 공개 미리 보기로 제공됩니다. 이 미리 보기 버전은 서비스 수준 계약 없이 제공되며, 프로덕션 워크로드에는 권장되지 않습니다. 특정 기능이 지원되지 않거나 기능이 제한될 수 있습니다. 자세한 내용은 Microsoft Azure Preview에 대한 추가 사용 약관을 참조하세요.
이 빠른 시작에서는 Azure Communication Services 관리 클라이언트 라이브러리를 사용하여 Azure Communication Services에서 도메인 제거 목록을 관리하는 프로세스를 다룹니다.
필수 조건
- 활성 구독이 있는 Azure 계정. 체험 계정을 만듭니다.
- 도메인을 프로비전할 준비가 된 Azure Email Communication Services 리소스. 이메일 통신 리소스 만들기 시작
- 프로비전되고 이메일을 보낼 준비가 된 Azure 관리되는 도메인 또는 사용자 지정 도메인
- 우리는 인증을 위해 서비스 주체를 사용하고 있습니다. Azure AD(Active Directory) 애플리케이션의 클라이언트 ID, 테넌트 ID 및 클라이언트 암호 값을 환경 변수
AZURE_CLIENT_ID
,AZURE_TENANT_ID
및AZURE_CLIENT_SECRET
으로 설정합니다.
필요한 패키지 설치
dotnet add package Azure.ResourceManager.Communication
dotnet add package Azure.Identity
관리 클라이언트 초기화
도메인 및 이메일 리소스가 있는 구독의 구독 ID로 AZURE_SUBSCRIPTION_ID
환경 변수를 설정합니다. 코드 샘플을 실행하여 관리 클라이언트를 초기화합니다.
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Communication;
ArmClient client = new ArmClient(new DefaultAzureCredential());
도메인 리소스에 제거 목록 추가
이메일 메시지가 특정 주소로 전송되는 것을 차단하려면 첫 번째 단계는 도메인 리소스에 제거 목록을 설정하는 것입니다.
제거 목록을 만들려는 리소스 그룹 이름, 이메일 서비스 이름 및 도메인 리소스 이름으로 코드 샘플을 업데이트합니다. 필수 구성 요소를 설정할 때 만든 도메인 리소스로 이동하여 포털에서 이 정보를 찾습니다. 리소스의 제목은 <your-email-service-name>/<your-domain-name>
입니다. 도메인 리소스 개요의 필수 섹션에서 리소스 그룹 이름과 구독 ID를 찾습니다. 제거 목록 리소스의 이름을 선택하고 샘플의 해당 필드도 업데이트합니다.
목록 이름은 이메일을 표시하지 않으려는 MailFrom 주소의 보낸 사람 사용자 이름과 동일한지 확인합니다. 이러한 MailFrom 주소는 포털에 있는 도메인 리소스의 "MailFrom 주소" 섹션에서 찾을 수 있습니다. 예를 들어, "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net"과 같은 MailFrom 주소가 있을 수 있습니다. 이 주소의 보낸 사람 사용자 이름은 "donotreply"이므로 "donotreply"라는 목록 이름을 사용해야 합니다.
코드 샘플은 제거 목록을 만들고 향후 작업을 위해 이를 suppressionListResource
변수에 저장합니다.
string subscriptionId = "<your-subscription-id>"; // Found in the essentials section of the domain resource portal overview
string resourceGroupName = "<your-resource-group-name>"; // Found in the essentials section of the domain resource portal overview
string emailServiceName = "<your-email-service-name>"; // Found in the first part of the portal domain resource title
string domainResourceName = "<your-domain-name>"; // Found in the second part of the portal domain resource title
string suppressionListResourceName = "<your-suppression-list-resource-name>";
ResourceIdentifier suppressionListResourceId = SuppressionListResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, emailServiceName, domainResourceName, suppressionListResourceName);
SuppressionListResource suppressionListResource = client.GetSuppressionListResource(suppressionListResourceId);
SuppressionListResourceData suppressionListData = new SuppressionListResourceData()
{
ListName = "<your-sender-username>", // Should match the sender username of the MailFrom address you would like to suppress emails from
};
suppressionListResource.Update(WaitUntil.Completed, suppressionListData);
특정 도메인의 모든 보낸 사람 사용자 이름에서 이메일을 표시하지 않으려면 목록 이름에 빈 문자열을 전달할 수 있습니다.
SuppressionListResourceData suppressionListData = new SuppressionListResourceData()
{
ListName = "",
};
suppressionListResource.Update(WaitUntil.Completed, suppressionListData);
제거 목록에 주소 추가
제거 목록을 설정한 후 이제 이메일 메시지가 전송되는 것을 방지하려는 특정 이메일 주소를 추가할 수 있습니다.
제거 목록 주소 ID로 코드 샘플을 업데이트합니다. 추가하는 모든 제거 목록 주소 ID는 고유해야 합니다. GUID를 사용하는 것이 좋습니다. 메시지 수신을 차단하려는 이메일 주소도 업데이트합니다.
제거 목록에 여러 주소를 추가하려면 이 코드 샘플을 여러 번 반복해야 합니다.
string suppressionListAddressId = "<your-suppression-list-address-id>";
ResourceIdentifier suppressionListAddressResourceId = SuppressionListAddressResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, emailServiceName, domainResourceName, suppressionListResourceName, suppressionListAddressId);
SuppressionListAddressResource suppressionListAddressResource = client.GetSuppressionListAddressResource(suppressionListAddressResourceId);
SuppressionListAddressResourceData suppressionListAddressData = new SuppressionListAddressResourceData()
{
Email = "<email-address-to-suppress>" // Should match the email address you would like to block from receiving your messages
};
suppressionListAddressResource.Update(WaitUntil.Completed, suppressionListAddressData);
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 표시되지 않은 주소로 전송되지 않습니다.
억제되지 않은 보낸 사람 사용자 이름으로 이메일을 보내려고 해도 이메일은 여전히 성공적으로 전송됩니다.
제거 목록에서 주소 제거
제거 목록에서 주소를 제거하려면 이전 코드 샘플에 표시된 대로 SuppressionListAddressResource
를 만들고 Delete
메서드를 호출합니다.
suppressionListAddressResource.Delete(WaitUntil.Completed);
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 이전에 표시되지 않은 주소로 성공적으로 전송됩니다.
도메인 리소스에서 제거 목록 제거
도메인 리소스에서 제거 목록을 제거하려면 이전 코드 샘플에 표시된 대로 SuppressionListResource
를 만들고 Delete
메서드를 호출합니다.
suppressionListResource.Delete(WaitUntil.Completed);
필수 조건
- 활성 구독이 있는 Azure 계정. 체험 계정을 만듭니다.
- 도메인을 프로비전할 준비가 된 Azure Email Communication Services 리소스. 이메일 통신 리소스 만들기 시작
- 프로비전되고 이메일을 보낼 준비가 된 Azure 관리되는 도메인 또는 사용자 지정 도메인
- 우리는 인증을 위해 서비스 주체를 사용하고 있습니다. Azure AD(Active Directory) 애플리케이션의 클라이언트 ID, 테넌트 ID 및 클라이언트 암호 값을 환경 변수
AZURE_CLIENT_ID
,AZURE_TENANT_ID
및AZURE_CLIENT_SECRET
으로 설정합니다.
필요한 패키지 설치
npm install @azure/arm-communication
npm install @azure/identity
관리 클라이언트 초기화
샘플 코드의 필드를 도메인 및 이메일 리소스가 있는 구독의 구독 ID로 바꿉니다. 코드 샘플을 실행하여 관리 클라이언트를 초기화합니다.
const { CommunicationServiceManagementClient } = require("@azure/arm-communication");
const { DefaultAzureCredential } = require("@azure/identity");
const credential = new DefaultAzureCredential();
const subscriptionId = "<your-subscription-id>";
const client = new CommunicationServiceManagementClient(credential, subscriptionId);
도메인 리소스에 제거 목록 추가
이메일 메시지가 특정 주소로 전송되는 것을 차단하려면 첫 번째 단계는 도메인 리소스에 제거 목록을 설정하는 것입니다.
제거 목록을 만들려는 리소스 그룹 이름, 이메일 서비스 이름 및 도메인 리소스 이름으로 코드 샘플을 업데이트합니다. 필수 구성 요소를 설정할 때 만든 도메인 리소스로 이동하여 포털에서 이 정보를 찾습니다. 리소스의 제목은 <your-email-service-name>/<your-domain-name>
입니다. 도메인 리소스 개요의 필수 섹션에서 리소스 그룹 이름과 구독 ID를 찾습니다. 제거 목록 리소스의 이름을 선택하고 샘플의 해당 필드도 업데이트합니다.
목록 이름은 이메일을 표시하지 않으려는 MailFrom 주소의 보낸 사람 사용자 이름과 동일한지 확인합니다. 이러한 MailFrom 주소는 포털에 있는 도메인 리소스의 "MailFrom 주소" 섹션에서 찾을 수 있습니다. 예를 들어, "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net"과 같은 MailFrom 주소가 있을 수 있습니다. 이 주소의 보낸 사람 사용자 이름은 "donotreply"이므로 "donotreply"라는 목록 이름을 사용해야 합니다.
const resourceGroupName = "<your-resource-group-name>"; // Found in the essentials section of the domain resource portal overview
const emailServiceName = "<your-email-service-name>"; // Found in the first part of the portal domain resource title
const domainResourceName = "<your-domain-name>"; // Found in the second part of the portal domain resource title
const suppressionListResourceName = "<your-suppression-list-resource-name>";
parameters = {
"listName": "<your-sender-username>", // Should match the sender username of the MailFrom address you would like to suppress emails from
}
await client.suppressionLists.createOrUpdate(
resourceGroupName,
emailServiceName,
domainResourceName,
suppressionListResourceName,
parameters
);
특정 도메인의 모든 보낸 사람 사용자 이름에서 이메일을 표시하지 않으려면 목록 이름에 빈 문자열을 전달할 수 있습니다.
parameters = {
"listName": "",
}
await client.suppressionLists.createOrUpdate(
resourceGroupName,
emailServiceName,
domainResourceName,
suppressionListResourceName,
parameters
);
제거 목록에 주소 추가
제거 목록을 설정한 후 이제 이메일 메시지가 전송되는 것을 방지하려는 특정 이메일 주소를 추가할 수 있습니다.
제거 목록 주소 ID로 코드 샘플을 업데이트합니다. 추가하는 모든 제거 목록 주소 ID는 고유해야 합니다. GUID를 사용하는 것이 좋습니다. 메시지 수신을 차단하려는 이메일 주소도 업데이트합니다.
제거 목록에 여러 주소를 추가하려면 이 코드 샘플을 여러 번 반복해야 합니다.
const suppressionListAddressId = "<your-suppression-list-address-id>";
parameters = {
"email": "<email-address-to-suppress>" // Should match the email address you would like to block from receiving your messages
}
await client.suppressionListAddresses.createOrUpdate(
resourceGroupName,
emailServiceName,
domainResourceName,
suppressionListResourceName,
suppressionListAddressId,
parameters
);
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 표시되지 않은 주소로 전송되지 않습니다.
억제되지 않은 보낸 사람 사용자 이름으로 이메일을 보내려고 해도 이메일은 여전히 성공적으로 전송됩니다.
제거 목록에서 주소 제거
제거 목록에서 주소를 제거하려면 suppressionListAddresses
에서 delete
메서드를 호출합니다.
await client.suppressionListAddresses.delete(
resourceGroupName,
emailServiceName,
domainResourceName,
suppressionListResourceName,
suppressionListAddressId
);
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 이전에 표시되지 않은 주소로 성공적으로 전송됩니다.
도메인 리소스에서 제거 목록 제거
도메인 리소스에서 제거 목록을 제거하려면 suppressionList
에서 delete
메서드를 호출합니다.
await client.suppressionLists.delete(
resourceGroupName,
emailServiceName,
domainResourceName,
suppressionListResourceName
);
필수 조건
- 활성 구독이 있는 Azure 계정. 체험 계정을 만듭니다.
- 도메인을 프로비전할 준비가 된 Azure Email Communication Services 리소스. 이메일 통신 리소스 만들기 시작
- 프로비전되고 이메일을 보낼 준비가 된 Azure 관리되는 도메인 또는 사용자 지정 도메인
- 우리는 인증을 위해 서비스 주체를 사용하고 있습니다. Azure AD(Active Directory) 애플리케이션의 클라이언트 ID, 테넌트 ID 및 클라이언트 암호 값을 환경 변수
AZURE_CLIENT_ID
,AZURE_TENANT_ID
및AZURE_CLIENT_SECRET
으로 설정합니다.
필요한 패키지 설치
pom.xml
에 다음 종속성을 추가합니다.
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-communication</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.11.1</version>
</dependency>
관리 클라이언트 초기화
도메인 및 이메일 리소스가 있는 구독의 구독 ID로 AZURE_SUBSCRIPTION_ID
환경 변수를 설정합니다.
파일 상단에 다음 가져오기를 추가합니다.
import com.azure.core.credential.TokenCredential;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.management.profile.AzureProfile;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.resourcemanager.communication.CommunicationManager;
코드 샘플을 실행하여 관리 클라이언트를 초기화합니다.
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
CommunicationManager manager = CommunicationManager
.authenticate(credential, profile);
도메인 리소스에 제거 목록 추가
이메일 메시지가 특정 주소로 전송되는 것을 차단하려면 첫 번째 단계는 도메인 리소스에 제거 목록을 설정하는 것입니다.
제거 목록을 만들려는 리소스 그룹 이름, 이메일 서비스 이름 및 도메인 리소스 이름으로 코드 샘플을 업데이트합니다. 필수 구성 요소를 설정할 때 만든 도메인 리소스로 이동하여 포털에서 이 정보를 찾습니다. 리소스의 제목은 <your-email-service-name>/<your-domain-name>
입니다. 도메인 리소스 개요의 필수 섹션에서 리소스 그룹 이름과 구독 ID를 찾습니다. 제거 목록 리소스의 이름을 선택하고 샘플의 해당 필드도 업데이트합니다.
목록 이름은 이메일을 표시하지 않으려는 MailFrom 주소의 보낸 사람 사용자 이름과 동일한지 확인합니다. 이러한 MailFrom 주소는 포털에 있는 도메인 리소스의 "MailFrom 주소" 섹션에서 찾을 수 있습니다. 예를 들어, "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net"과 같은 MailFrom 주소가 있을 수 있습니다. 이 주소의 보낸 사람 사용자 이름은 "donotreply"이므로 "donotreply"라는 목록 이름을 사용해야 합니다.
String resourceGroupName = "<your-resource-group-name>"; // Found in the essentials section of the domain resource portal overview
String emailServiceName = "<your-email-service-name>"; // Found in the first part of the portal domain resource title
String domainResourceName = "<your-domain-name>"; // Found in the second part of the portal domain resource title
String suppressionListResourceName = "<your-suppression-list-resource-name>";
manager.suppressionLists().define(suppressionListResourceName)
.withExistingDomain(resourceGroupName, emailServiceName, domainResourceName)
.withListName("<your-sender-username>") // Should match the sender username of the MailFrom address you would like to suppress emails from
.create();
특정 도메인의 모든 보낸 사람 사용자 이름에서 이메일을 표시하지 않으려면 목록 이름에 빈 문자열을 전달할 수 있습니다.
manager.suppressionLists().define(suppressionListResourceName)
.withExistingDomain(resourceGroupName, emailServiceName, domainResourceName)
.withListName("")
.create();
제거 목록에 주소 추가
제거 목록을 설정한 후 이제 이메일 메시지가 전송되는 것을 방지하려는 특정 이메일 주소를 추가할 수 있습니다.
제거 목록 주소 ID로 코드 샘플을 업데이트합니다. 추가하는 모든 제거 목록 주소 ID는 고유해야 합니다. GUID를 사용하는 것이 좋습니다. 메시지 수신을 차단하려는 이메일 주소도 업데이트합니다.
제거 목록에 여러 주소를 추가하려면 이 코드 샘플을 여러 번 반복해야 합니다.
String suppressionListAddressId = "<your-suppression-list-address-id>";
manager.suppressionListAddresses().define(suppressionListAddressId)
.withExistingSuppressionList(resourceGroupName, emailServiceName, domainResourceName, suppressionListResourceName)
.withEmail("<email-address-to-suppress>") // Should match the email address you would like to block from receiving your messages
.create();
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 표시되지 않은 주소로 전송되지 않습니다.
억제되지 않은 보낸 사람 사용자 이름으로 이메일을 보내려고 해도 이메일은 여전히 성공적으로 전송됩니다.
제거 목록에서 주소 제거
제거 목록에서 주소를 제거하려면 suppressionListAddresses
에서 delete
메서드를 호출합니다.
manager.suppressionListAddresses()
.delete(resourceGroupName, emailServiceName, domainResourceName, suppressionListResourceName, suppressionListAddressId);
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 이전에 표시되지 않은 주소로 성공적으로 전송됩니다.
도메인 리소스에서 제거 목록 제거
도메인 리소스에서 제거 목록을 제거하려면 suppressionLists
에서 delete
메서드를 호출합니다.
manager.suppressionLists()
.delete(resourceGroupName, emailServiceName, domainResourceName, suppressionListResourceName);
필수 조건
- 활성 구독이 있는 Azure 계정. 체험 계정을 만듭니다.
- 도메인을 프로비전할 준비가 된 Azure Email Communication Services 리소스. 이메일 통신 리소스 만들기 시작
- 프로비전되고 이메일을 보낼 준비가 된 Azure 관리되는 도메인 또는 사용자 지정 도메인
- 우리는 인증을 위해 서비스 주체를 사용하고 있습니다. Azure AD(Active Directory) 애플리케이션의 클라이언트 ID, 테넌트 ID 및 클라이언트 암호 값을 환경 변수
AZURE_CLIENT_ID
,AZURE_TENANT_ID
및AZURE_CLIENT_SECRET
으로 설정합니다.
필요한 패키지 설치
pip install azure-mgmt-communication
pip install azure-identity
관리 클라이언트 초기화
도메인 및 이메일 리소스가 있는 구독의 구독 ID로 AZURE_SUBSCRIPTION_ID
환경 변수를 설정합니다. 코드 샘플을 실행하여 관리 클라이언트를 초기화합니다.
from azure.mgmt.communication import CommunicationServiceManagementClient
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
subscription_id = "<your-subscription-id>"
mgmt_client = CommunicationServiceManagementClient(credential, subscription_id)
도메인 리소스에 제거 목록 추가
이메일 메시지가 특정 주소로 전송되는 것을 차단하려면 첫 번째 단계는 도메인 리소스에 제거 목록을 설정하는 것입니다.
제거 목록을 만들려는 리소스 그룹 이름, 이메일 서비스 이름 및 도메인 리소스 이름으로 코드 샘플을 업데이트합니다. 필수 구성 요소를 설정할 때 만든 도메인 리소스로 이동하여 포털에서 이 정보를 찾습니다. 리소스의 제목은 <your-email-service-name>/<your-domain-name>
입니다. 도메인 리소스 개요의 필수 섹션에서 리소스 그룹 이름과 구독 ID를 찾습니다. 제거 목록 리소스의 이름을 선택하고 샘플의 해당 필드도 업데이트합니다.
목록 이름은 이메일을 표시하지 않으려는 MailFrom 주소의 보낸 사람 사용자 이름과 동일한지 확인합니다. 이러한 MailFrom 주소는 포털에 있는 도메인 리소스의 "MailFrom 주소" 섹션에서 찾을 수 있습니다. 예를 들어, "donotreply@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.azurecomm.net"과 같은 MailFrom 주소가 있을 수 있습니다. 이 주소의 보낸 사람 사용자 이름은 "donotreply"이므로 "donotreply"라는 목록 이름을 사용해야 합니다.
resource_group_name = "<your-resource-group-name>"; # Found in the essentials section of the domain resource portal overview
email_service_name = "<your-email-service-name>"; # Found in the first part of the portal domain resource title
domain_resource_name = "<your-domain-name>"; # Found in the second part of the portal domain resource title
suppression_list_resource_name = "<your-suppression-list-resource-name>";
mgmt_client.suppression_lists.create_or_update(
resource_group_name,
email_service_name,
domain_resource_name,
suppression_list_resource_name,
parameters={
"properties": {
"listName": "<your-sender-username>" # Should match the sender username of the MailFrom address you would like to suppress emails from
}
},
)
특정 도메인의 모든 보낸 사람 사용자 이름에서 이메일을 표시하지 않으려면 목록 이름에 빈 문자열을 전달할 수 있습니다.
mgmt_client.suppression_lists.create_or_update(
resource_group_name,
email_service_name,
domain_resource_name,
suppression_list_resource_name,
parameters={
"properties": {
"listName": ""
}
},
)
제거 목록에 주소 추가
제거 목록을 설정한 후 이제 이메일 메시지가 전송되는 것을 방지하려는 특정 이메일 주소를 추가할 수 있습니다.
제거 목록 주소 ID로 코드 샘플을 업데이트합니다. 추가하는 모든 제거 목록 주소 ID는 고유해야 합니다. GUID를 사용하는 것이 좋습니다. 메시지 수신을 차단하려는 이메일 주소도 업데이트합니다.
제거 목록에 여러 주소를 추가하려면 이 코드 샘플을 여러 번 반복해야 합니다.
suppression_list_address_id = "<your-suppression-list-address-id>";
mgmt_client.suppression_list_addresses.create_or_update(
resource_group_name,
email_service_name,
domain_resource_name,
suppression_list_resource_name,
suppression_list_address_id,
parameters={
"properties": {
"email": "<email-address-to-suppress>" # Should match the email address you would like to block from receiving your messages
}
},
)
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 표시되지 않은 주소로 전송되지 않습니다.
억제되지 않은 보낸 사람 사용자 이름으로 이메일을 보내려고 해도 이메일은 여전히 성공적으로 전송됩니다.
제거 목록에서 주소 제거
제거 목록에서 주소를 제거하려면 suppression_list_addresses
에서 delete
메서드를 호출합니다.
mgmt_client.suppression_list_addresses.delete(
resource_group_name,
email_service_name,
domain_resource_name,
suppression_list_resource_name,
suppression_list_address_id
)
이제 통신 서비스 리소스의 TryEmail
섹션에서 또는 이메일 SDK 중 하나를 사용하여 표시되지 않은 주소로 이메일을 보낼 수 있습니다. 표시하지 않도록 선택한 보낸 사람 사용자 이름과 함께 MailFrom 주소를 사용하여 이메일을 보냅니다. 사용자의 이메일은 이전에 표시되지 않은 주소로 성공적으로 전송됩니다.
도메인 리소스에서 제거 목록 제거
도메인 리소스에서 제거 목록을 제거하려면 suppression_lists
에서 delete
메서드를 호출합니다.
mgmt_client.suppression_lists.delete(
resource_group_name,
email_service_name,
domain_resource_name,
suppression_list_resource_name
)