Nodemailer 7 + AWS SESv2 + TypeScript: TS2769 "SES does not exist in type TransportOptions"

1 week ago 14
ARTICLE AD BOX

I'm trying to send emails using Nodemailer 7.0.11 with AWS SESv2 and TypeScript, but I'm running into this compile error when creating the transporter:

No overload matches this call. The last overload gave the following error. Object literal may only specify known properties, and 'SES' does not exist in type 'TransportOptions | Transport<unknown, TransportOptions>'.ts(2769) index.d.ts(70, 17): The last overload is declared here.

Here's the relevant code:

import nodemailer from 'nodemailer' import {SESv2Client} from "@aws-sdk/client-sesv2"; import {SendEmailCommand} from "@aws-sdk/client-ses"; // 1. Configure the AWS SDK client (uses default credential chain if omitted) const sesClient = new SESv2Client({ region: "us‑east‑1" }); // 2. Create a Nodemailer transport that points at SES const transporter = nodemailer.createTransport({ SES: { sesClient, SendEmailCommand }, });

Environment:

[email protected] @aws-sdk/client-sesv2@latest (AWS SDK v3) TypeScript with strict: true
Read Entire Article