# SMTP.js not working? A safe alternative with your SMTP

> SMTP.js stopped working: smtpjs.com no longer serves the library. Send form emails through your own SMTP with no password in your page, 1,000 free a month.

Source: https://formsmtp.com/alternatives/smtpjs · Last updated November 2, 2026

SMTP.js gave the browser an `Email.send()` function. It was free, but your page had to carry your SMTP login, or a SecureToken that only worked with the SMTP providers SMTP.js chose. Today the smtpjs.com domain no longer serves the library or its docs.

## What happened to SMTP.js

When we checked in November 2026, smtpjs.com no longer served the script at `smtpjs.com/v3/smtp.js` (the request was refused), its home page redirected to another site, and its sitemap listed unrelated pages, including one about “responsible gambling”. Archived copies show gambling content on the domain by May 2026. If `Email.send()` stopped working on your site, your code isn’t the problem: the script and service it loaded from smtpjs.com aren’t there any more.

Browsers can’t open SMTP connections, so `Email.send()` always went through SMTP.js’s own server. Per the archived smtpjs.com, you either passed `Host`, `Username` and `Password` in your page, where anyone could read them, or turned them into a `SecureToken` locked to one domain. In January 2024 the token generator only accepted Elastic Email’s SMTP servers; by October 2025, only smtphosting.com’s. Even with a token, any script running on your page could send to any address.

|  | SMTP.js | FormSMTP |
| --- | --- | --- |
| What’s in your page | SMTP login, or a SecureToken | A form key that can only email you |
| SMTP provider | Any with a login; tokens only for the provider SMTP.js picked | Any: Gmail, Microsoft 365, Zoho, SES, Brevo… |
| Who can receive | Any address | Your own inbox (form key), or recipients you allow (API key, from a server) |
| Status, November 2026 | Not served from smtpjs.com | Running |

## Replace Email.send() with fetch()

```js
// Before: SMTP.js
Email.send({
  SecureToken: "…",
  To: "you@yourdomain.com",
  From: "you@yourdomain.com",
  Subject: "New message",
  Body: message,
}).then((result) => alert(result));

// After: FormSMTP form endpoint (no script tag needed)
const res = await fetch("https://app.formsmtp.com/api/v1/form/YOUR_FORM_KEY", {
  method: "POST",
  headers: { "Content-Type": "application/json", Accept: "application/json" },
  body: JSON.stringify({ _subject: "New message", email: visitorEmail, message }),
});
const data = await res.json(); // { success: true } or { success: false, error }
```

The email goes to your own inbox, from your own address, with the visitor’s email as reply-to. If you used SMTP.js to email other people, such as a confirmation to the visitor, call FormSMTP’s [send API](https://formsmtp.com/docs) from a server instead, so the key that can email anyone stays private.

## SMTP.js vs FormSMTP pricing

### SMTP.js

|  |  |  |
| --- | --- | --- |
| smtp.js script | Was free | No longer served from smtpjs.com |
| SecureToken | Free | Elastic Email only (2024), then smtphosting.com only (2025) |

From archived copies of smtpjs.com ([January 2024](https://web.archive.org/web/20240110215639/https://smtpjs.com/), [October 2025](https://web.archive.org/web/20251022112059/http://smtpjs.com/)) and smtpjs.com itself, November 2026.

### FormSMTP

|  |  |  |
| --- | --- | --- |
| Free | $0 | 1,000 / month |
| Founding member | $0 | 10,000 / month (first 2,000 accounts) |
| Pro | $5/mo ($48/yr) | 50,000 / month |
| Agency | $15/mo ($144/yr) | 250,000 / month |

## Why people switch

- No SMTP password or token in your page: the form key can only email you
- Any SMTP provider: Gmail, Microsoft 365, Zoho, SES, Brevo and more
- 1,000 free emails a month, logs and spam protection
- One fetch() call, no third-party script to load

## Is there still a reason to use SMTP.js?

- Not for new projects: the script and its service aren’t served from smtpjs.com any more.
- If you must email any address straight from the browser, no front-end-only tool can do that safely. Send from a server, with FormSMTP’s send API or your own backend.

## Switching takes five minutes

1. [Create a free account](https://app.formsmtp.com/#/signup) and connect your SMTP account.
2. Remove the `smtp.js` script tag and replace `Email.send({…})` with a `fetch()` to `https://app.formsmtp.com/api/v1/form/YOUR_FORM_KEY`, sending your fields as JSON. If your SMTP password was ever in your page, or behind a SecureToken, change it.
3. Submit a test message and check *Logs*.

## FAQ

### Is FormSMTP a drop-in SMTP.js replacement?

For contact and signup forms, yes. Point your form at FormSMTP, keep your field names, and connect the SMTP account you want to send from. Remove the smtp.js script tag and replace Email.send({…}) with a fetch() to https://app.formsmtp.com/api/v1/form/YOUR_FORM_KEY, sending your fields as JSON. If your SMTP password was ever in your page, or behind a SecureToken, change it.

### Is FormSMTP free like SMTP.js?

FormSMTP’s free plan includes 1,000 emails a month through your own SMTP account, with no card. SMTP.js was free too, but it’s no longer served, and its tokens only worked with the SMTP providers it picked.

### Why is SMTP.js not working?

Because smtpjs.com no longer serves the library: when we checked in November 2026, the script URL was refused and the domain showed unrelated content. Replace Email.send() with a form endpoint, or with an email API called from your server.

### Is it safe to put SMTP credentials in JavaScript?

No. Anyone can read your page source and use the login to send email as you. Keep SMTP logins on a server; FormSMTP stores them encrypted and gives your page a key that can only email you.

### What’s the catch?

You connect your own SMTP account (Gmail, Zoho, SES…). Most people already have one, and it means emails come from your own address with your own sender reputation.
