npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-terazone-smtp

v0.1.1

Published

n8n community node for sending secure emails via Terazone SMTP using raw TCP connection

Readme

n8n-nodes-terazone-smtp

Custom n8n community node for sending secure emails with file attachments via Terazone SMTP using a direct raw TCP connection.

Why a Custom Node?

n8n's built-in Code node runs in a sandboxed environment that blocks direct TCP socket connections (net.createConnection). Terazone SMTP requires a raw TCP connection with no TLS and no authentication — a custom node is the only way to achieve this within n8n.

Installation

From npm (recommended)

  1. In your n8n instance, go to Settings > Community Nodes
  2. Click Install a community node
  3. Enter: n8n-nodes-terazone-smtp
  4. Click Install

The node will be available immediately — no restart needed.

Manual Installation

# Navigate to your n8n user directory
cd ~/.n8n

# Install the package
npm install n8n-nodes-terazone-smtp

# Restart n8n

Credentials Setup

  1. In n8n, go to Credentials > Add Credential
  2. Search for "Terazone SMTP"
  3. Fill in the following fields:

| Field | Type | Required | Default | Description | |---|---|---|---|---| | SMTP Host | string | Yes | — | Terazone SMTP server hostname | | SMTP Port | number | Yes | 25 | Terazone SMTP server port | | From Address | string | Yes | — | Sender email address used in MAIL FROM | | EHLO Domain | string | Yes | mail.example.com | Domain sent in the SMTP EHLO handshake | | Connection Timeout (ms) | number | No | 10000 | Maximum time to wait for the SMTP connection |

Node Parameters

| Parameter | Type | Required | Description | |---|---|---|---| | To Email | string | Yes | Recipient email address. Comma-separated for multiple recipients. | | Subject | string | Yes | Email subject line. | | Body | string | No | Plain text email body. | | Phone Numbers | string | No | Comma-separated phone numbers. Appended to the subject as #phone# identifiers for tracking. | | Attachment Source | select | Yes | Choose between Binary Property or Base64 String. | | Binary Property Name | string | Conditional | Name of the binary property from a previous node (shown when source = Binary Property). Default: data. | | Attachment File Name | string | Conditional | File name including extension (shown when source = Base64 String). | | Attachment Base64 Content | string | Conditional | Base64-encoded file content (shown when source = Base64 String). |

Usage Examples

Example 1: Send a simple test email

Use a Manual Trigger connected to the Terazone Secure Mail node with these settings:

  • To Email: [email protected]
  • Subject: Test from n8n
  • Body: This is a test email
  • Phone Numbers: 0501234567
  • Attachment Source: Base64 String
  • Attachment File Name: test.txt
  • Attachment Base64 Content: SGVsbG8gV29ybGQ=

The SGVsbG8gV29ybGQ= value is "Hello World" in base64. The resulting subject will be: Test from n8n #0501234567#.

Example 2: Send a PDF from an HTTP Request

[Manual Trigger] → [HTTP Request] → [Terazone Secure Mail]
  1. HTTP Request node: download a PDF with Response Format set to File
  2. Terazone Secure Mail node:
    • Attachment Source: Binary Property
    • Binary Property Name: data

The node automatically reads the file name and base64 content from the binary data.

Example 3: Dynamic input from previous node

All parameters support n8n expressions. Connect a Set node or any data source:

  • To Email: {{ $json.toEmail }}
  • Subject: {{ $json.subject }}
  • Body: {{ $json.body }}
  • Phone Numbers: {{ $json.phoneNumbers }}
  • Attachment File Name: {{ $json.attachmentFileName }}
  • Attachment Base64 Content: {{ $json.attachmentBase64 }}

Sample input JSON for testing:

{
  "toEmail": "[email protected]",
  "subject": "Monthly report for January 2025",
  "body": "Hello, please find the attached report.",
  "phoneNumbers": "0501234567",
  "attachmentFileName": "test-result.txt",
  "attachmentBase64": "SGVsbG8gV29ybGQ="
}

Output

On success the node outputs:

{
  "success": true,
  "to": ["[email protected]"],
  "subject": "Test from n8n #0501234567#",
  "attachmentFileName": "test.txt"
}

On failure (with Continue On Fail enabled):

{
  "success": false,
  "error": "SMTP connection timed out after 10000ms"
}

How It Works

The node opens a raw TCP socket to the Terazone SMTP server and performs the standard SMTP command sequence:

Client connects via TCP
Server: 220 ...
Client: EHLO mail.example.com
Server: 250 OK
Client: MAIL FROM: <[email protected]>
Server: ... Sender OK
Client: RCPT TO: <[email protected]>
Server: ...
Client: DATA
Server: ... Start mail input
Client: [MIME headers + multipart body with base64 attachment]
Client: .
Server: ... Queued mail for delivery
Client closes connection

Key details:

  • No TLS — plain TCP connection
  • No authentication — the Terazone relay does not require credentials
  • MIME multipart — attachment sent as application/octet-stream with base64 encoding
  • UTF-8 support — subject and file name are encoded using RFC 2047 Base64 (=?UTF-8?B?...?=) for Hebrew and other non-ASCII characters
  • Timeout — configurable, defaults to 10 seconds

Troubleshooting

| Issue | Solution | |---|---| | Node doesn't appear in n8n | Restart n8n after manual installation. For npm install via UI, it should appear immediately. | | SMTP connection timed out | Verify network connectivity from the n8n server to the SMTP host:port. Check firewalls. | | SMTP connection error: ECONNREFUSED | SMTP server is down or port is blocked by a firewall. | | Garbled subject or filename | This is typically a mail client display issue. The node uses standard RFC 2047 Base64 UTF-8 encoding. | | Continue On Fail shows error JSON | This is expected behavior — the node catches the error and outputs it as data instead of stopping the workflow. |

Compatibility

  • n8n: >= 1.0.0
  • Node.js: >= 18
  • Runtime dependencies: None (uses only Node.js built-in modules net and readline)

License

MIT