> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tawked.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending over SMTP

> Send Tawked Email from a system that only speaks SMTP: the server settings, how recipients and attachments are handled, the reply codes, and setups for Laravel, WordPress and Nodemailer.

The SMTP server sends through the same account, domains, limits and balance as [`POST /v1/email/messages`](/email/messages). Use it when a system can only send e-mail over SMTP; anything you build yourself is simpler on the API.

## Settings

| Setting | Value |
| - | - |
| Server | `smtp.tawked.com` |
| Port | `587` with STARTTLS, or `465` with TLS from the first byte |
| Username | `tawked` |
| Password | A `tk_live_` key of the application with Email set to send (`email:send`), or a key with full access |

The console shows the same settings on the application's **Email** page, and the key is made under **Application settings → API keys**. The key decides the application: its verified domains, its log and its webhooks. A `tk_test_` key is refused, as on the API.

TLS is required. On port 587 the server refuses to log in before STARTTLS; port 465 is encrypted from the start. Plain port 25 is not offered.

## What is sent

* **From** must be an address on a verified domain of the key's application, any local part. The name in the From header is kept.
* **Each recipient is its own message.** Every address in To, Cc and Bcc is sent as a separate message, recorded in the log with its own id, counted against the daily limit and charged as one message. A Bcc address never appears in the copies the others receive.
* **Reply-To**, the subject, the HTML part and the text part are kept as written.
* **Attachments** are carried, up to 10 MiB together (the whole e-mail can be up to 12 MiB). Executable types (such as `.exe`, `.bat`, `.cmd`, `.com`, `.js`, `.msi`, `.scr` and `.vbs`) are refused.

Every recipient is tried once the whole e-mail has arrived. When one is refused (for example an address on the account's suppression list) the others are still sent, and the reply to the e-mail is that refusal, `550 5.7.1` for a suppressed address. Sending the same e-mail again is safe: the recipients that already received it are not sent a second copy. The messages appear in **Email → Messages** and send the same `email.*` [webhooks](/email/messages#webhooks) as the API's.

## Reply codes

A reply that starts with 5 is permanent: fix the cause before sending again. A reply that starts with 4 is temporary: your mail client or library retries later on its own. The reply's text says which case it is.

| Code | When | Retry |
| - | - | - |
| `250 2.6.0` | Accepted. The text lists the message ids, one per recipient. | |
| `535 5.7.8` | The password is not a live key with the e-mail permission (any username is accepted). | No |
| `538 5.7.0` | Login was tried before STARTTLS on port 587. | No |
| `530 5.7.0` | A message was started without logging in. | No |
| `454 4.7.0` | Too many failed logins from your address in 15 minutes, or the login could not be checked right now. | Later |
| `550 5.7.1` | The From address is not on a verified domain of the key's application, the application has no verified domain, the recipient is on the suppression list, or the key or account may not send. | No |
| `550 5.1.3` | A recipient address is not valid. | No |
| `550 5.6.0` | The e-mail has no subject, a subject over 255 characters, or neither an HTML nor a text part. | No |
| `552 5.3.4` | The e-mail is over 12 MiB, its attachments together are over 10 MiB, or its HTML and text are over the API's limit. | No |
| `554 5.7.1` | An attachment has a refused executable type. | No |
| `554 5.6.0` | An attachment cannot be read, there are more than 10, or the e-mail cannot be parsed. | No |
| `452 4.5.3` | More than 50 recipients in one e-mail: the rest are refused at `RCPT TO`; send them in another e-mail. | Later |
| `451 4.7.1` | The account reached its limit for this minute, or sending is paused for the account. | Later |
| `452 4.7.1` | The account reached its daily limit (Riyadh time), or the balance is below the price of a message. | Later |
| `451 4.3.0` | A temporary error on Tawked's side. | Later |
| `421 4.7.0` | Too many connections from your address in one minute. | Later |

## Laravel

In `.env`:

```bash theme={"dark"}
MAIL_MAILER=smtp
MAIL_SCHEME=smtp
MAIL_HOST=smtp.tawked.com
MAIL_PORT=587
MAIL_USERNAME=tawked
MAIL_PASSWORD=tk_live_your_key
MAIL_FROM_ADDRESS=orders@acme.sa
MAIL_FROM_NAME="Acme"
```

`MAIL_SCHEME=smtp` on port 587 upgrades the connection with STARTTLS. For port 465 use `MAIL_SCHEME=smtps` and `MAIL_PORT=465`. Laravel versions before 11 read `MAIL_ENCRYPTION=tls` instead of `MAIL_SCHEME`.

## WordPress

With the WP Mail SMTP plugin, choose **Other SMTP** as the mailer and fill in:

| Field | Value |
| - | - |
| SMTP Host | `smtp.tawked.com` |
| Encryption | TLS |
| SMTP Port | `587` |
| Auto TLS | On |
| Authentication | On |
| SMTP Username | `tawked` |
| SMTP Password | Your `tk_live_` key |

Set **From Email** to an address on your verified domain and turn on **Force From Email**. For port 465, choose SSL as the encryption.

## Nodemailer

```js theme={"dark"}
import nodemailer from 'nodemailer';

const transport = nodemailer.createTransport({
  host: 'smtp.tawked.com',
  port: 587,
  secure: false,
  requireTLS: true,
  auth: { user: 'tawked', pass: process.env.TAWKED_KEY },
});

await transport.sendMail({
  from: '"Acme" <orders@acme.sa>',
  to: 'customer@example.com',
  subject: 'Your order 1042 is on its way',
  text: 'Your order 1042 left our warehouse today.',
  html: '<p>Your order 1042 left our warehouse today.</p>',
});
```

For port 465, set `port: 465` and `secure: true`, and leave out `requireTLS`.

Keep the key on the server, in an environment variable or a secret store, never in code a browser or a phone app receives.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.