Click here to Skip to main content
15,670,344 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello guys, I'm kind of stuck, I'm trying to send a password reset email using AWS SES in Next.js. But I am getting the error below:

MultipleValidationErrors: There were 2 validation errors:
* MissingRequiredParameter: Missing required key 'Message' in params
* UnexpectedParameter: Unexpected key 'message' found in params

What I have tried:




Main Code:

import User from '../models/user';
import { hashPassword, comparePassword } from '../utils/auth';
import jwt from 'jsonwebtoken';
import AWS from 'aws-sdk';

const awsConfig = {
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
  secretAccessKey: process.env.AWS_ACCESS_KEY_ID,
  region: process.env.AWS_REGION,
  apiVersion: process.env.AWS_API_VERSION,

const SES = new AWS.SES(awsConfig);

export const sendTestEmail = (req, res) => {

  let params = {
    Source: process.env.EMAIL_FROM,
    Destination: {
      ToAddresses: ['email_to_send_to'],
    ReplyToAddresses: [process.env.EMAIL_FROM],
    message: {
      Body: {
        Html: {
          Charset: 'UTF-8',
          Data: `
              <h1> Reset Password Link </h1>
              <p> Kindly use the link below to reset your password <p/>
      Subject: {
        Charset: 'UTF-8',
        Data: `Reset Password Link`,

  const emailSent = SES.sendEmail(params).promise();

    .then((data) => {
      res.json({ ok: true });
    .catch((err) => {
Updated 11-Nov-21 1:39am
Member 15329613 10-Nov-21 16:57pm    
I have not used this technology but from the error message it would indicate that you need to change "message" to "Message", right?
Amogs 10-Nov-21 18:14pm    
Thanks man. Funny enough, I had looked at the said 'm' a thousand times today and my mind was showing me a capital 'm'. Not until you confirmed to me it was a small 'm', I changed it and it worked immediately.
Member 15329613 11-Nov-21 7:38am    
Ha! That's happened to all of us. No worries. Glad it worked.

1 solution

As mentioned in the comments, the lower case 'm' should be an upper case 'M' on message.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900