yaserso
yaserso

Reputation: 2868

AWS SES says email address is not verified, even though it's for ccAddress, not from?

I keep getting the following error in Express:

MessageRejected: Email address is not verified. The following identities failed the check in region EU-WEST-1: [email protected]

Here is my code:

// Set the region 
AWS.config.update({region: 'eu-west-1'});

// Create sendEmail params 
var params = {
  Destination: { /* required */
    CcAddresses: [
      '[email protected]',
    ],
    ToAddresses: [
      '[email protected]',
    ]
  },
  Message: { /* required */
    Body: { /* required */
      Html: {
       Charset: "UTF-8",
       Data: "HTML_FORMAT_BODY"
      },
      Text: {
       Charset: "UTF-8",
       Data: "TEXT_FORMAT_BODY"
      }
     },
     Subject: {
      Charset: 'UTF-8',
      Data: 'Test email'
     }
    },
  Source: '[email protected]', /* required */
};

// Create the promise and SES service object
var sendPromise = new AWS.SES({apiVersion: '2010-12-01'}).sendEmail(params).promise();

// Handle promise's fulfilled/rejected states
sendPromise.then(
  function(data) {
    res.send(data.MessageId);
  }).catch(
    function(err) {
    console.error(err, err.stack);
  })

[email protected] and address@email are verified, but email@gmail is not. How can I send to users if I have to verify them? Am I using the wrong AWS service?

Upvotes: 1

Views: 5049

Answers (1)

Vladyslav Usenko
Vladyslav Usenko

Reputation: 2386

When you're using SES sandbox, addresses, to which you send emails, should be verified by SES - it is done for your wallet security. It won't require that in production mode.

See: Moving Out of the Amazon SES Sandbox - Amazon Simple Email Service

Upvotes: 6

Related Questions