如何使用Amazon SES邮箱模拟器

时间:2012-10-07 08:27:23

标签: c# amazon-ses

我正在使用亚马逊.net SDK。我理解用Simulator mailboxes发送邮件。但是不明白在TO,FROM字段中使用模拟器邮件,客户邮件的位置。

例如:我有CustomerMailMyVerifiedMailSimulatorMails,包括bounce@simulator.amazonses.com,success @ simulator.amazonses.com,ooto @ simulator.amazonses.com等...

我的代码在这里

SendEmailRequest req = new SendEmailRequest()                        
                        .WithDestination(new Destination() { ToAddresses = { CustomerMail } })
                        .WithSource(VerifiedMail)
                        .WithReturnPath(VerifiedMail)
                        .WithMessage(
                            new Amazon.SimpleEmail.Model.Message(new Content("Title"),
                            new Body().WithHtml(new Content("Body"));

WithDestination: CustomerMail,WithSource: VerifiedMail,WithReturnPath: SimulatorMail?

WithDestination: SimulatorMail,WithSource: CustomerMail,WithReturnPath:已验证邮件?

请告诉我如何使用模拟器?

1 个答案:

答案 0 :(得分:1)

你读过这个http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/MailboxSimulator.html吗?

像往常一样使用MailboxSimulator,只是不同:你必须使用模拟器的电子邮件。

在您的代码中:

SendEmailRequest req = new SendEmailRequest()                        
                    .WithDestination(new Destination() { ToAddresses = { SimulatorMails } })
                    .WithSource(VerifiedMail)
                    .WithReturnPath(VerifiedMail)
                    .WithMessage(
                        new Amazon.SimpleEmail.Model.Message(new Content("Title"),
                        new Body().WithHtml(new Content("Body"));