Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a Node.js app that needs standard email sending and may change providers, start by evaluating SMTP. Choose a provider’s HTTP API when a specific API feature or an API-centered stack justifies tighter integration with that provider. Neither connection method alone guarantees better inbox placement.

What SMTP relay and email API mean in Node.js

SMTP and an email API are two ways for your application to hand a message to a delivery service. They do not determine whether the message is transactional or marketing email. Nodemailer constructs messages and sends them through a transport; the provider is the service that delivers them.

With SMTP, Nodemailer connects to a provider’s mail server using SMTP connection and authentication settings. With an API, your application sends requests through a provider-specific HTTP interface, often using that provider’s SDK. The API can expose provider-specific functions, but code that depends on them may be harder to move to another service.

SMTP relay vs. email API: the practical differences

Decision SMTP relay Email API
Compatibility and portability SMTP is widely supported. A provider change may require mainly a configuration change, though it is not guaranteed to be effortless. Nodemailer describes SMTP transport. A provider-specific HTTP interface can expose extra features, but relying on those features can couple your application to that vendor. Nodemailer discusses the trade-off.
Node.js integration Nodemailer includes an SMTP transport configured with connection and authentication options. SMTP transport documentation. Nodemailer includes an Amazon SES transport using the AWS SDK v3; its transports documentation also lists a community Mailgun HTTP API transport. Nodemailer transport list.
Authentication and security Configure credentials and TLS according to the provider. For Amazon SES, SMTP requires TLS and SES SMTP credentials differ from AWS credentials. AWS SES SMTP connection documentation and SES SMTP credentials. Use the provider’s API or SDK authentication model. For SES, Nodemailer’s documented transport takes an initialized AWS SDK client. Nodemailer SES transport.
Provider-specific capabilities Provides a common sending path, while provider behavior and account features can still vary. May expose provider-specific functions. Choose it when a particular function matters to your application.
Price, limits, and delivery performance Check the chosen provider and account configuration; no cross-provider comparison is established here. Check the chosen provider and account configuration; no cross-provider comparison is established here.

Nodemailer calls SMTP a standard protocol used by email servers and notes that many providers support it, even when they emphasize API sending. Treat that as implementation guidance, not a promise of effortless migration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the connection method that fits your application

Prefer SMTP when portability matters

  • You need ordinary message sending rather than a feature unique to one provider.
  • You want to preserve the option to switch providers by changing transport settings instead of building around a vendor-specific interface.
  • Your deployment or mail software already supports SMTP.

Prefer an API when its specific capabilities matter

  • A provider’s API or SDK offers a function your application actually needs.
  • Your application already uses that provider’s API and the additional integration is worth the provider coupling.
  • You can manage the provider-specific authentication, SDK, and error handling as part of your application.

Do not choose based on an assumption that one method inherently improves deliverability. The comparison here does not establish that; delivery depends on more than the connection protocol.

Configure a Node.js sender with Nodemailer

Nodemailer’s transports include SMTP, sendmail, SES, stream, and JSON. SMTP and SES can connect to delivery services; stream and JSON are useful for custom processing or debugging rather than live provider delivery. Reuse a configured transporter rather than creating one for every message, and keep credentials out of source code.

SMTP setup

Nodemailer’s SMTP transport accepts host, port, security, and authentication settings. Its well-known service presets include examples such as Mailgun (smtp.mailgun.org), Resend (smtp.resend.com), SendGrid (smtp.sendgrid.net), Brevo (smtp-relay.brevo.com), Postmark (smtp.postmarkapp.com), and regional SES endpoints. Presets are configuration aids: they do not create an account, verify availability in your region, or complete authentication. Nodemailer specifically leaves provider authentication to you.

Use the chosen provider’s documented port, TLS mode, and credentials. Nodemailer’s examples show credentials supplied through environment variables; do not commit secrets to your repository.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Amazon SES through SMTP or API

Amazon SES supports both methods. AWS describes SMTP as an option for SMTP-enabled software or a mail server, and its API as an option for raw HTTP requests. AWS SES SMTP sending overview.

  • SES over SMTP: Connect to the appropriate SES endpoint with TLS and use SES SMTP credentials. Ordinary AWS credentials are not interchangeable with SES SMTP credentials. AWS connection requirements and credential details.
  • SES through Nodemailer’s API transport: Install the AWS SDK v3 SES client package, initialize the SDK client with your AWS configuration, and provide that client to the SES transport. Nodemailer SES setup.

SES is a useful example because the delivery provider stays the same while the connection method changes. Compare the integration and operational requirements of both options in your own application.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the provider and account before launch

A transport preset or successful connection does not settle the account-level questions that affect production use. Confirm the selected service’s current pricing, sending limits, regional availability, and account requirements directly with that provider; those values are not comparable across providers from the information here.

Nodemailer’s Gmail guide reports limits of 500 recipients per rolling 24-hour period for personal Gmail accounts and 2,000 for Google Workspace accounts. It says each address counts individually, including To, Cc, and Bcc; the guide’s publication date is not stated. These are figures attributed to Nodemailer, not a substitute for checking current Google policies. Nodemailer recommends a dedicated email provider for reliable higher-volume sending. Nodemailer’s Gmail guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.