0

I am trying to send a simple email through the AWS SES service. Unfortunately I keep getting an error:

com.amazonaws.services.simpleemail.model.AmazonSimpleEmailServiceException: Missing final '@domain' (Service: AmazonSimpleEmailService; Status Code: 400; Error Code: InvalidParameterValue; Request ID: [id]; Proxy: null)

The code is almost straight from the examples:

AmazonSimpleEmailService client = this.getClient();
            SendEmailRequest request = new SendEmailRequest().withDestination(new Destination().withToAddresses(this.emailTo))
                    .withMessage(new Message().withSubject(new com.amazonaws.services.simpleemail.model.Content().withData(email.getTitle()))
                            .withBody(new Body().withText(
                                    new com.amazonaws.services.simpleemail.model.Content().withCharset("UTF-8").withData(email.getContent()))))
                    .withSource(this.emailFrom).withConfigurationSetName("name").withReplyToAddresses(email.getEmailFrom());
            client.sendEmail(request);

In the emailFrom and emailTo fields, a SES-verified email address with a correctly entered domain and @ sign is provided. In mail.getEmailFrom() adress have domain and @ too.

What I can do?

I tried changing the settings, giving addresses manually, and also as arrays. If I specify "Amazon Resource Name (ARN)" instead of emailFrom, I get an error:

com.amazonaws.services.simpleemail.model.AmazonSimpleEmailServiceException: Nested group (Service: AmazonSimpleEmailService; Status Code: 400; Error Code: InvalidParameterValue; Request ID: [id]; Proxy: null)
czarobest
  • 31
  • 6
  • 2
    try to log the email from, to,body and see everything is filled correctly – Mohamed Anser Ali Jun 20 '23 at 13:53
  • https://stackoverflow.com/questions/27648163/ses-error-missing-final-domain – Mark B Jun 20 '23 at 13:55
  • @MohamedAnserAli my objects before sendEmail call is filled correctly: {Source: "email@gmail.com",Destination: {ToAddresses: ["email@gmail.com"],CcAddresses: [],BccAddresses: []},Message: {Subject: {Data: test-946822128,Charset: UTF-8},Body: {Text: {Data: content484059615,Charset: UTF-8},}},ReplyToAddresses: [email@gmail.com],Tags: [],ConfigurationSetName: name} I replace my verified mail by "email". Okay I see that now unnecessary apostrophes crept in... – czarobest Jun 20 '23 at 14:20

0 Answers0