我编写了以下 .net 代码,以在 AWS-SES"电子邮件地址身份列表"中添加运行时电子邮件地址,并将电子邮件发送给用户进行验证,但它不起作用,尽管响应说"等待激活"。但是,SES"电子邮件地址身份"中既未添加电子邮件地址,也没有将电子邮件发送到相应的电子邮件地址进行验证。任何帮助,不胜感激。
public void SESVerifyEmailIdentity()
{
var sesClient = new AmazonSimpleEmailServiceClient("XXXXXXXXXXXXX", "XXXXXXXXXXX", "USEast1");
var request = new VerifyEmailIdentityRequest
{
EmailAddress = "Joe@example.com"
};
var response = sesClient.VerifyEmailIdentityAsync(request);
}
我解决了我的问题,我没有为 AWS 使用正确的凭证。当我使用 AWS 凭证时,它对我有用。
public void SESVerifyEmailIdentity()
{
#region SESVerifyEmailIdentity
var awsCredentials = new
Amazon.Runtime.BasicAWSCredentials("YOUR-ACCESS-KEY-HERE", "YOUR-SECRET-KEY-HERE);
var sesClient = new AmazonSimpleEmailServiceClient(awsCredentials, RegionEndpoint.USEast1);
var request = new VerifyEmailIdentityRequest
{
EmailAddress = "Joe@Example.com"
};
var response = sesClient.VerifyEmailIdentityAsync(request);
#endregion
}