Docs / General Information

Sending email through the Postwing service

Postwing is a convenient service for sending email with support for SMTP and a REST API. Authentication is handled through a Token, which contains a login and a password.

What is a token in Postwing?

A token is the entity used to authenticate when sending email. It consists of:

  • A login (set when the token is created)
  • A password (generated automatically; it cannot be recovered)

You can manage tokens on the “Token management” page. If the password is lost, the token must be deleted and created again.

Sending email over SMTP

Postwing provides an SMTP relay that accepts three connection modes — SSL/TLS (implicit), STARTTLS, and plain (no encryption):

  • Server address: smtp.postwing.app
  • Ports:
    • SSL / TLS: 465, 8465
    • STARTTLS: 587, 8587
    • Without encryption: 25, 8025

SMTP client settings

  • Login and password — the credentials from your token
  • For a secure connection, use port 465 with SSL/TLS — it is encrypted from the first byte and the simplest to configure. Port 587 with STARTTLS works just as well if your client prefers it.
  • Each mode is also available on a high port (8465, 8587, 8025) — use it if your hosting provider blocks the standard mail ports on outbound connections.

Full connection details, per-mode explanations and swaks test commands are on the SMTP page.

Sending email over the REST API

The REST API is a programmatic interface for sending email over HTTP requests. This approach is convenient when:

  • You need to integrate with a web or mobile application
  • You need control over the sending process (logging, error handling)
  • You need idempotency support (repeated requests do not duplicate the send)

Example request

Request URL: POST /external/send_email_simple/

Payload:

json
{
    "recipient": "email@test.com",
    "subject": "Subject",
    "body": "Email Content",
    "sender": "from me <email@test.com>",
    "idempotency_key": "xxxxxx",
    "auth": {
        "username": "Username",
        "password": "Password"
    }
}

Example call with curl

bash
curl -X POST "https://smtp.postwing.app/external/send_email_simple/" \
     -H "Content-Type: application/json" \
     -d '{
         "recipient": "email@test.com",
         "subject": "Test Email",
         "body": "Hello, this is a test email!",
         "sender": "sender@test.com",
         "idempotency_key": "12345",
         "auth": {
             "username": "your_token_login",
             "password": "your_token_password"
         }
     }'

Integration examples for popular frameworks

They are available in the menu on the left. If you can’t find a guide for your framework — let us know!

Postwing offers flexible ways to send email — choose SMTP for classic use cases, or the REST API for automated scenarios.