Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastnloud/nest-mail

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastnloud/nest-mail

Mail module for Nest that uses Nodemailer to deliver messages.

  • 0.0.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-60.22%
Maintainers
1
Weekly downloads
 
Created
Source

Description

Mail module for Nest that uses Nodemailer to deliver messages.

Installation

$ npm i --save @fastnloud/nest-mail

Setup

Import module:

import { MailModule } from '@fastnloud/nest-mail';
import { Module } from '@nestjs/common';

@Module({
  imports: [MailModule],
})
export class AppModule {}

A sample .env file looks something like this:

MAIL_DEFAULT_FROM_ADDRESS=john.doe@example.com
MAIL_DEFAULT_FROM_NAME=John Doe
MAIL_RECIPIENTS=
MAIL_URL=smtp://localhost:1025

Usage

import { SmtpTransporter } from '@fastnloud/nest-mail';
import { Injectable } from '@nestjs/common';
import { SentMessageInfo } from 'nodemailer';

@Injectable()
export class MailService {
  constructor(private readonly smtpTransporter: SmtpTransporter) {}

  async send(): Promise<void> {
    this.smtpTransporter.send(
      {
        to: 'jane.doe@example.com',
        subject: `hello`,
        text: 'world',
      },
      (error: Error | null, info: SentMessageInfo) => {
        if (error) {
          throw error;
        }

        console.log(info);
      },
    );
  }
}

License

nest-mail is MIT licensed.

Keywords

FAQs

Package last updated on 29 Mar 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc