Reputation: 11687
I recently signed up for Amazon SES service. I have generated my SMTP settings, Access Key and Secret Key. Also I DO NOT have Production Access now. I am a .Net developer and was trying to Verify Email Address through my code. Below is the code snippet:
var amConfig = new AmazonSimpleEmailServiceConfig {UseSecureStringForAwsSecretKey = false};
var amzClient = new AmazonSimpleEmailServiceClient(_awsAccessKey, _awsSecretKey, amConfig);
var veaRequest = new VerifyEmailAddressRequest {EmailAddress = "[email protected]"};
VerifyEmailAddressResponse veaResponse = amzClient.VerifyEmailAddress(veaRequest);
string requestId = veaResponse.ResponseMetadata.RequestId;
return requestId;
But I am receiving following error:
Amazon.SimpleEmail.AmazonSimpleEmailServiceException : User: myUsername is not authorized to perform: ses:VerifyEmailAddress ----> System.Net.WebException : The remote server returned an error: (403) Forbidden.
Also I tried some other operations like ListVerifiedEmailAddresses, but ended up with same result.
Could anyone please help me on whats going here?
Posting the question on Amazon developers forum was of no use. No reply till now. Also I suspect that I need to have Production Access to call this method. Is it? Also remember I am able to Send Email successfully using AWS SMTP settings.
Thanks.
Upvotes: 1
Views: 5749
Reputation: 2132
Are you using credentials associated with an IAM user? If this is the case, you need to add a policy to the IAM user that will allow those specific actions in SES. Something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1402494612000",
"Effect": "Allow",
"Action": [
"ses:ListVerifiedEmailAddresses",
"ses:VerifyEmailAddress"
],
"Resource": [
"*"
]
}
]
}
Upvotes: 3