Email
Email over SMTP
SMTP API integration

SMTP API integration


To integrate with the SMTP API, you need the applicable SMTP server information. The following table shows the available endpoints for the SMTP servers and port numbers, dependent on each region.

RegionSMTP serverPorts
Europesmtp-api.infobip.com587, 465
Great Britainsmtp-api-gb1.infobip.com587, 465
India (Mumbai)smtp-api-mum.infobip.com587, 465
Indonesiasmtp-api-id.infobip.com587, 465
MENAsmtp-api-ae2.infobip.com587
Pakistansmtp-api-pk2.infobip.com587
Qatarsmtp-api-qa1.infobip.com587
Saudi Arabiasmtp-api-sa2.infobip.com587
Türkiyesmtp-api-tr1.infobip.com587
USsmtp-api-us.infobip.com587, 465

For Schrems II (opens in a new tab) compliance, use smtp-api-eu.infobip.com with one of the standard available ports: 587 or 465.

When using port 587, an explicit STARTTLS command is required, while a connection over port 465 implies that the TLS handshake has already been completed. TLS communication is mandatory on any port.

NoteSMTP API endpoint white-labeling is also supported. Contact Support or your dedicated account manager to enable this option.

SMTP authentication

SMTP authentication (SMTP AUTH) ensures that only authorized users can send emails through the Infobip SMTP API. By enforcing valid credentials before permitting message transmission, SMTP AUTH helps prevent unauthorized access or server abuse.

Infobip SMTP supports the PLAIN and LOGIN authentication mechanisms:

  • PLAIN - transmits the username and password in a single Base64-encoded string
  • LOGIN - transmits the username and password individually, each encoded as Base64 string

Your authentication credentials can be submitted in two ways:

  1. Basic authentication - use your Infobip account username and password.
  2. API key authentication - username is always App, and the password is the API key created on your Infobip account.

In both cases, the username and password must be submitted as Base64-encoded strings.

Note

Some libraries, such as OpenSSL, may terminate the connection if the letter Q is inserted as the first character in a line. This may cause problems when using a base64-encoded username such as App, which encodes to QXBw in base64 and therefore begins with Q.

To avoid this issue, use the -quiet option in OpenSSL or start the line with one or more blank spaces before entering the username.

See API authentication for more information on using API keys.


Supported SMTP commands

The Infobip SMTP server supports the following commands:

SMTP commandDescription
HELPReturns information about supported SMTP commands and their usage.
HELOInitiates a new SMTP session.
Identifies the client to the SMTP server using the client’s domain name or hostname. Used in standard SMTP.
EHLOInitiates an Extended SMTP (ESMTP) session.
Identifies the client to the server and requests a list of ESMTP extensions supported by the server.
STARTTLSUpgrades the existing SMTP connection to use TLS (Transport Layer Security) for secure communication.
AUTHAuthenticates the client to the server, using a username and password.
PLAIN and LOGIN authentication mechanisms supported.
MAILSpecifies the sender’s email address, also known as Envelope From.
In addition to the FROM parameter, SIZE parameter is also used to announce the size of the email.
Begins the process of sending a new email transaction.
RCPTSpecifies a recipient’s email address, also known as Envelope To.
Used for each recipient of the message (To, Cc, Bcc).
For multiple recipients, the command is repeated for each address.
DATASignals the beginning of the email content (headers and body).
The server replies with a 354 response, prompting the client to send the message data.
The data ends with a single line containing <CRLF>.<CRLF>.
RSETResets the current mail transaction, clearing any senders or recipients specified, but keeps the SMTP connection open.
QUITTerminates the SMTP session and closes the connection.
NOOPHealth check.
Note

It is recommended, but not strictly required by RFC, that all email addresses listed in the To and Cc headers within the DATA section are also specified as recipients using the RCPT command during the SMTP transaction.

Only addresses provided via RCPT will actually receive the message, but addresses in headers alone will not.


RFC-compliant headers

The Infobip platform supports RFC-compliant headers for outgoing SMTP emails.

Commonly used headers include:

  • In-Reply-To - supports message threading
  • References - provides context for message threads
  • List-Unsubscribe - enables recipients to unsubscribe from mailing lists
  • List-Unsubscribe-Post - extends unsubscribe functionality for automated handling

Optional custom headers

Custom headers allow you to include additional information in outgoing SMTP emails. The following table provides a list of custom header names used in email communication.

Header nameDescription
X-IB-Bulk-IdThe ID that uniquely identifies the sent bulk. This filter enables the client to query delivery reports for all the messages using just one request.
X-IB-Callback-DataAdditional client data that will be sent on the X-IB-Notify-Url.
X-IB-Intermediate-ReportThe real-time intermediate delivery report that will be sent on the client's callback server.
X-IB-Notify-Content-TypePreferred delivery report content type. Can be application/json or application/xml.
X-IB-Notify-UrlThe URL on the client's callback server on which the delivery report will be sent.
X-IB-Tracking-UrlThe URL on the client's callback server on which the open and click notifications will be sent.
See Tracking notifications for details.
X-IB-Client-PrioritySets the priority of the email. Allowed values: HIGH, STANDARD, LOW. If not specified, the default is STANDARD. Higher priority messages are sent before lower priority ones from your account.
X-IB-Application-IdUsed to specify the application in outbound send requests. The same value is also returned in notification events.
X-IB-Entity-IdUsed to specify an entity in outbound send requests. The same value is also included in notification events.

Need assistance

Explore Infobip Tutorials

Encountering issues

Contact our support

What's new? Check out

Release Notes

Unsure about a term? See

Glossary
Service status

Copyright @ 2006-2025 Infobip ltd.

Service Terms & ConditionsPrivacy policyTerms of use