Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/manyuanrong/deno-smtp
SMTP implements for deno
https://github.com/manyuanrong/deno-smtp
Last synced: 19 days ago
JSON representation
SMTP implements for deno
- Host: GitHub
- URL: https://github.com/manyuanrong/deno-smtp
- Owner: manyuanrong
- License: mit
- Created: 2019-06-27T13:35:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-29T23:51:11.000Z (7 months ago)
- Last Synced: 2024-11-13T21:04:13.167Z (29 days ago)
- Language: TypeScript
- Size: 36.1 KB
- Stars: 80
- Watchers: 5
- Forks: 26
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - deno-smtp - 基于SMTP的邮件发送工具。 (Uncategorized / Uncategorized)
- awesome-deno-cn - @manyuanrong/deno-smtp
- awesome-deno - deno-smtp - A smtp mail sender for deno.![GitHub stars](https://img.shields.io/github/stars/manyuanrong/deno-smtp?style=plastic) (Modules / Online Playgrounds)
- awesome-deno - deno-smtp - A smtp mail sender for deno. (Modules / Mail)
README
## Deno SMTP mail client
[![Build Status](https://github.com/manyuanrong/deno-smtp/workflows/ci/badge.svg?branch=master)](https://github.com/manyuanrong/deno-smtp/actions)
![GitHub](https://img.shields.io/github/license/manyuanrong/deno-smtp.svg)
![GitHub release](https://img.shields.io/github/release/manyuanrong/deno-smtp.svg)
![(Deno)](https://img.shields.io/badge/deno-1.0.0-green.svg)### Example
```ts
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";const client = new SmtpClient();
await client.connect({
hostname: "smtp.163.com",
port: 25,
username: "username",
password: "password",
});await client.send({
from: "[email protected]",
to: "[email protected]",
subject: "Mail Title",
content: "Mail Content",
html: "Github",
});await client.close();
```#### TLS connection
```ts
await client.connectTLS({
hostname: "smtp.163.com",
port: 465,
username: "username",
password: "password",
});
```#### Use in Gmail
```ts
await client.connectTLS({
hostname: "smtp.gmail.com",
port: 465,
username: "your username",
password: "your password",
});await client.send({
from: "[email protected]", // Your Email address
to: "[email protected]", // Email address of the destination
subject: "Mail Title",
content: "Mail Content,maybe HTML",
});await client.close();
```### Configuring your client
You can pass options to your client through the `SmtpClient` constructor.
```ts
import { SmtpClient } from "https://deno.land/x/smtp/mod.ts";//Defaults
const client = new SmtpClient({
content_encoding: "quoted-printable", // 7bit, 8bit, base64, binary, quoted-printable
});
```