Home > database >  Amazon SES error: The From ARN is not a valid SES identity
Amazon SES error: The From ARN is not a valid SES identity

Time:04-11

I am new to amazone SES and trying to set up my .net core API to send emails using SES. Here is code I`m using to send emails:

SendEmailRequest request = new SendEmailRequest();
        request.FromEmailAddress = "[email protected]";//verified
        //request.
        Destination destination= new Destination();
        destination.ToAddresses = new List<string> {"some verified email"};
        request.Destination = destination;
        EmailContent content = new EmailContent();
        
        content.Simple = new Message
        {
            Body = new Body
            {
                Html = new Content
                {
                    Data = $@"<html>
                    //here is some code
                    </html>"
                }
            },
            Subject = new  Content{
                Data = "some subject"
            }
        };
        request.Content = content;
        request.FromEmailAddressIdentityArn = senderArn;
        var status = await _sesClient.SendEmailAsync(request); 

This code gives me such error: The From ARN <arn:aws:ses:eu-central-1:xxxxxxxxxxxxxx> is not a valid SES identity. On AWS console emails are verified: screenshot from console

Any ideas what I`m doing wrong?

CodePudding user response:

Here is .NET Code that does work. The sender has to be verified in SES. See enter image description here

  • Related