Socket
Socket
Sign inDemoInstall

@types/nodemailer

Package Overview
Dependencies
2
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/nodemailer

TypeScript definitions for nodemailer


Version published
Maintainers
1
Created

Package description

What is @types/nodemailer?

The @types/nodemailer package provides TypeScript type definitions for Nodemailer, a module for Node.js applications to allow easy email sending. The types enable TypeScript developers to use Nodemailer in their projects with the benefits of type checking and IntelliSense in their IDE. This package does not contain functionality by itself but adds type support for using Nodemailer in a TypeScript environment.

What are @types/nodemailer's main functionalities?

Sending Emails

This feature allows you to send emails using Nodemailer. The code sample demonstrates how to set up a transporter, configure it with SMTP server details, and send an email with both text and HTML content.

import nodemailer from 'nodemailer';

async function sendEmail() {
  let transporter = nodemailer.createTransport({
    host: 'smtp.example.com',
    port: 587,
    secure: false, // true for 465, false for other ports
    auth: {
      user: 'example@example.com', // generated ethereal user
      pass: 'password' // generated ethereal password
    }
  });

  let info = await transporter.sendMail({
    from: '"Fred Foo 👻" <foo@example.com>', // sender address
    to: 'bar@example.com, baz@example.com', // list of receivers
    subject: 'Hello ✔', // Subject line
    text: 'Hello world?', // plain text body
    html: '<b>Hello world?</b>' // html body
  });

  console.log('Message sent: %s', info.messageId);
}

sendEmail();

Other packages similar to @types/nodemailer

Readme

Source

Installation

npm install --save @types/nodemailer

Summary

This package contains type definitions for nodemailer (https://github.com/nodemailer/nodemailer).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodemailer.

Additional Details

  • Last updated: Thu, 02 May 2024 17:07:42 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Rogier Schouten, Piotr Roszatycki, and Daniel Chao.

FAQs

Last updated on 02 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc