

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 将 Amazon SES 与 Microsoft Windows Server IIS SMTP 集成
<a name="send-email-windows-server"></a>

您可以将 Microsoft Windows Server 的 IIS SMTP 服务器配置为通过 Amazon SES 发送电子邮件。这些说明是在亚马逊 EC2 实例上使用微软 Windows Server 2022 编写的。您可以在 Microsoft Windows Server 2016 上使用相同的配置。

**注意**  
Windows Server 是第三方应用程序，不由 Amazon Web Services 开发或支持。本节中的步骤仅供参考，如有变更，恕不另行通知。

**将 Microsoft Windows Server IIS SMTP 服务器与 Amazon SES 集成**

1. 首先，按照以下说明设置微软 Windows Server 2022。

   1. 从[亚马逊 EC2 管理控制台](https://console.aws.amazon.com/ec2/home)启动新的微软 Windows Server 2022 Base 亚马逊 EC2 实例。

   1. 按照 [Amazon EC2 Windows 实例入门](https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2Win_GetStarted.html)中的说明，使用远程桌面连接到实例并登录。

   1. 启动服务器管理器控制面板。

   1. 安装 **Web Server** 角色。请确保包含 **IIS 10 Management Compatibility tools**（**Web Server** 复选框下的一个选项）。

   1. 安装 **SMTP Server** 特征。

1. 接下来，使用以下说明配置 IIS SMTP 服务。

   1. 返回到服务器管理器控制面板。

   1. 从 **Tools（工具）**菜单中，选择 **Internet Information Services（IIS）10.0 Manager**。

   1. 右键单击 **SMTP Virtual Server \$11**，然后选择 **Properties**。

   1. 在 **Access** 选项卡的 **Relay Restrictions** 下，选择 **Relay**。

   1. 在 **Relay Restrictions** 对话框中，选择 **Add**。

   1. 在 **Single Computer** 下，输入 **127.0.0.1** 作为 IP 地址。您现在已授予此服务器访问权限，以通过 IIS SMTP 服务将电子邮件中继到 Amazon SES。

      在此过程中，我们假定电子邮件是在此服务器上生成的。如果生成电子邮件的应用程序在其他服务器上运行，则您必须在 IIS SMTP 中为该服务器授予中继访问权限。
**注意**  
要将 SMTP 中继扩展到私有子网，对于 **Relay Restriction**，请使用 **Single Computer** 127.0.0.1 和 **Group of Computers** 172.1.1.0：255.255.255.0（在网络掩码部分中）。在 **Connection**（连接）中，请使用 **Single Computer** 127.0.0.1 和 **Group of Computers** 172.1.1.0：255.255.255.0（在网络掩码部分中）。

1. 最后，使用以下说明将服务器配置为通过 Amazon SES 发送电子邮件。

   1. 返回到 **SMTP Virtual Server \$11 Properties** 对话框，然后选择 **Delivery** 选项卡。

   1. 在 **Delivery** 选项卡上，选择 **Outbound Security**。

   1. 选择 **Basic Authentication**（基本身份验证），然后输入您的 Amazon SES SMTP 凭证。您可以使用[获取 Amazon SES SMTP 凭证](smtp-credentials.md)中的过程从 Amazon SES 控制台获取这些凭证。
**重要**  
您的 SMTP 凭证与您的 AWS 访问密钥 ID 和私有访问密钥不同。请勿尝试使用您的 AWS 凭据通过 SMTP 端点对自己进行身份验证。有关凭证的更多信息，请参阅[Amazon SES 凭证的类型](send-email-concepts-credentials.md)。

   1. 确保已选中 **TLS encryption**。

   1. 返回到 **Delivery** 选项卡。

   1. 选择 **Outbound Connections**。

   1. 在 **Outbound Connections** 对话框中，确保端口为 25 或 587。

   1. 选择 **Advanced**（高级）。

   1. 对于 **Smart host**（智能主机）名称，输入您将使用的 Amazon SES 端点（例如，*email-smtp.us-west-2.amazonaws.com*）。有关可用 Amazon SES URLs AWS 区域 的终端节点列表，请参阅中的[*AWS 一般参考*亚马逊简单电子邮件服务 (Amazon SES)](https://docs.aws.amazon.com/general/latest/gr/rande.html#ses_region) Service。

   1. 返回到服务器管理器控制面板。

   1. 在服务器管理器控制面板上，右键单击 **SMTP Virtual Server \$11**，然后重新启动该服务以选择新配置。

   1. 通过此服务器发送电子邮件。您可以检查邮件标头，以确认邮件已通过 Amazon SES 送达。