# directmail

> Sendmail replacement, sends mail directly to recipients SMTP server

Latest version **0.1.8** (published 2014-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install directmail
pnpm add directmail
yarn add directmail
bun add directmail
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2014-05-15 |
| First published | 2013-11-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Andris Reinman |
| Maintainers | andris |
| Keywords | SMTP, sendmail, Nodemailer, email |

## Links

- npm: https://www.npmjs.com/package/directmail
- Repository: https://github.com/andris9/directmail
- Issues: https://github.com/andris9/directmail/issues
- npm.io page: https://npm.io/package/directmail

## Dependencies (1)

- [simplesmtp](https://npm.io/package/simplesmtp.md) ~0.3.30

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.8 (latest) — 2014-05-15
- 0.1.7 — 2014-05-13
- 0.1.6 — 2013-12-05
- 0.1.5 — 2013-12-01
- 0.1.4 — 2013-12-01
- 0.1.3 — 2013-12-01
- 0.1.2 — 2013-11-25
- 0.1.1 — 2013-11-25
- 0.1.0 — 2013-11-22

## README

# DirectMail

Sendmail alternative to send e-mails directly to recipients without a relaying service.

### Support DirectMail development

[![Donate to author](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DB26KWR2BQX5W)

If you want to support with Bitcoins then my wallet address is `15Z8ADxhssKUiwP3jbbqJwA21744KMCfTM`

## Usage

### Setup

Require *directmail* object

    var createDirectmail = require("directmail"),
        directmail = createDirectmail(options);

Where

  * **options** is an optional options object with the following properties
    * *debug* - if set to true, prints all traffic to console
    * *name* - hostname to be used when introducing the client to the MX server

### Send mail

Push a message to the outgoing queue

    directmail.send({
        from: "sender@example.com",
        recipients: ["receiver1@example.com", "receiver2@example.com"],
        message: "Subject: test\r\n\r\nHello world!"
    });

Where

  * **from** (string) is the e-mail address of the sender
  * **recipients** (array) is an array of recipient e-mails. Put all `to`, `cc` and `bcc` addresses here.
  * **message** (string|buffer) is the RFC2822 message to be sent

### Check queue length

You can check the count of unsent messages from the `.length` property of the directmail object

    console.log(directmail.length); // nr of messages to be sent

If you try to send a message with multiple recipients then every unique recipient domain counts as a different message.

## Issues

*Directmail* is very inefficient as it queues all e-mails to be sent into memory. Additionally, if a message is not yet sent and the process is closed, all data about queued messages are lost. Thus *directmail* is only suitable for low throughput systems, like password remainders and such, where the message can be processed immediatelly. *Directmail* is not suitable for spamming.

While not being 100% reliable (remember - if process exits, entire queue is lost), *directmail* can still handle sending errors, graylisting and such. If a message can not be sent, it is requeued and retried later.

## License

**MIT**

---
_Source: https://npm.io/package/directmail · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
