Skip to main content

SMTP Servers

Configure one or more SMTP servers for email delivery. Posta routes emails through your configured SMTP servers.

tip

For the full request/response schema, see the interactive Swagger or ReDoc API documentation.

Adding an SMTP Server

Add a server from the dashboard or via POST /api/v1/users/me/smtp-servers. Example:

{
"host": "smtp.gmail.com",
"port": 587,
"username": "your-email@gmail.com",
"password": "your-app-password",
"encryption": "starttls",
"max_retries": 3,
"allowed_emails": ["noreply@yourdomain.com", "alerts@yourdomain.com"]
}

Encryption Options

ValuePortDescription
none25No encryption (not recommended)
starttls587Upgrade to TLS after connecting
ssl465TLS from the start

Testing Connections

Verify SMTP credentials and connectivity before sending via POST /api/v1/users/me/smtp-servers/{id}/test. This validates the hostname, port, credentials, and encryption.

Sender Restrictions

Use allowed_emails to restrict which sender addresses can use a specific SMTP server. This is useful when different servers are configured for different brands or departments.

note

Passwords are never returned in API responses.

Common SMTP Providers

ProviderHostPortEncryption
Gmailsmtp.gmail.com587starttls
Outlooksmtp.office365.com587starttls
Amazon SESemail-smtp.us-east-1.amazonaws.com587starttls
Mailgunsmtp.mailgun.org587starttls
Postfix (local)localhost25none