我已将AWS SNS反弹配置为调用我的HTTP endpoints . 我能够以https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-examples.html#notification-examples-bounce中指定的格式接收json的退回邮件 .
电子邮件使用SendEmail方法发送,自定义邮件标签包含在电子邮件中 . 有没有办法在弹跳json消息中接收标签?
using (var client = new AmazonSimpleEmailServiceClient())
{
List<MessageTag> lstMsgTag = new List<MessageTag>();
lstMsgTag.Add(new MessageTag { Name = "ServerCode", Value = "Code123" });
lstMsgTag.Add(new MessageTag { Name = "DBName", Value = "TestDB" });
var sendRequest = new SendEmailRequest
{
Source = senderAddress,
Destination = new Destination { ToAddresses = { receiverAddress } },
Message = new Message
{
Subject = new Content("Sample Mail using SES"),
Body = new Body { Text = new Content("Sample bounce message content.") }
},
Tags = lstMsgTag
};
try
{
Console.WriteLine("Sending email using AWS SES...");
var response = client.SendEmail(sendRequest);
Console.WriteLine("The email was sent successfully.");
}
catch (Exception ex)
{
Console.WriteLine("The email was not sent.");
Console.WriteLine("Error message: " + ex.Message);
}
}