SMTP API Documentation | Integrate Email Sending
Hand Emojji Images Your Success, Our Priority: Our team is here to assist you!
Developer Documentation

Send Mail API

Send email through SMTPProvider using a simple authenticated API endpoint.

POSTRequest method
1 endpointSend mail endpoint
multipart/form-dataRequest format
No matching documentation sections found.

MCP Integration Overview

The SMTPProvider MCP server exposes SMTPProvider's email-sending and reporting APIs as Model Context Protocol (MCP) tools, so an AI assistant or any MCP-compatible platform can send transactional email and pull delivery/bounce reports directly inside a conversation, without writing custom integration code.

MCP Server URL: https://app.smtpprovider.com/mcp

Protocol: MCP over JSON-RPC 2.0, HTTPS POST

Any platform with MCP (or "Custom Connector") support — including Claude ,Cursor and Grok — can connect to this URL. Once connected, the assistant can call three tools to send email and retrieve reports; see Available MCP Functionalities.

How to Connect MCP with AI

OAuth Login

Set the connector's server URL to https://app.smtpprovider.com/mcp, choose OAuth as the connection type, and enter the Client ID and Client Secret SMTPProvider support gives you into your platform's connector configuration. The first time you use the connector, your platform redirects you to an SMTPProvider sign-in page where you enter the username and password SMTPProvider support gives you to approve the connection; your platform then handles token exchange and renewal automatically (access tokens last 1 hour and refresh transparently). See MCP Authentication.

Setup Steps

  1. Open your AI platform's connector or integration settings and choose to add a custom MCP connector.
  2. Enter the server URL: https://app.smtpprovider.com/mcp.
  3. Enter the OAuth credentials SMTPProvider support gave you.
  4. Save the connector. Your platform calls the server's initialize and tools/list methods automatically and should list three tools: send_email, get_transaction_report, and get_bounce_report.
  5. Ask the assistant, in plain language, to send an email or pull a report.

MCP Authentication

Before connecting, contact SMTPProvider support to request the credentials for your MCP connection. These are account-specific and should be kept private.

MCP access involves separate credentials — don't confuse them:

CredentialPurposeHow to Obtain
Client ID / Client SecretRegistered in your AI platform's connector settings; authorizes your platform to open an OAuth connection to the MCP server.Contact SMTPProvider support.
Username / PasswordEntered on SMTPProvider's sign-in page when your platform redirects you there to approve an OAuth connection.Contact SMTPProvider support.

If SMTPProvider support configures a default account for your connection, you can omit the account token from individual tool calls; otherwise pass it as the token argument on send_email, get_transaction_report, or get_bounce_report.

A request without valid connector credentials receives an HTTP 401 Unauthorized response.

Available MCP Functionalities

The MCP server exposes three tools, each backed by an existing SMTPProvider REST endpoint documented elsewhere on this page.

ToolDescriptionREST Equivalent
send_emailSends a transactional email through SMTPProvider.Send Mail API
get_transaction_reportRetrieves paginated email delivery (send) report rows.All Report
get_bounce_reportRetrieves paginated bounced-email report rows.Bounce Report

An AI assistant discovers these automatically after connecting and calls them based on what you ask it to do — see Send Email Requirements and Email Reports.

Send Email Requirements

The send_email tool sends one transactional email per call.

Parameters

ParameterTypeDescriptionRequired
tostringRecipient email address.Yes
fromstringSender email address.Yes
from_namestringSender display name.Yes
subjectstringEmail subject line.Yes
bodystringEmail body. HTML is supported.Yes
tokenstringAccount token identifying which SMTPProvider account to send as — see MCP Authentication. Not required if SMTPProvider support has configured a default account for your MCP connection.No
attachmentsarrayOptional file attachments — see Attachment Fields below. Maximum 5 files.No

Attachment Fields

Each item in attachments is an object:

FieldTypeDescriptionRequired
filenamestringFile name including its extension, for example invoice.pdf.Yes
content_base64stringBase64-encoded file contents.Yes
content_typestringMIME type, for example application/pdf. Defaults to application/octet-stream.No

Allowed attachment types: pdf, doc, docx, xls, xlsx, txt, jpg, jpeg, png. Maximum 10MB per file (decoded size), up to 5 attachments per email.

Send requests are rate-limited to 3,000 requests per hour per account — the same limit enforced by the REST Send Mail API.

The tool's result contains the same response documented under the REST Responses section above.

Email Reports

get_transaction_report and get_bounce_report accept the same parameters and return paginated rows, newest first.

Parameters

ParameterTypeDescriptionRequired
from_datestringStart date, for example 2026-10-01.No
to_datestringEnd date, for example 2026-10-31. Must be on or after from_date.No
pageintegerPage number. Minimum 1; default is 1.No
per_pageintegerRecords per page. Range 1–100; default is 100.No
tokenstringAccount token identifying which SMTPProvider account to query — see MCP Authentication. Not required if SMTPProvider support has configured a default account for your MCP connection.No

get_transaction_report returns the same response shape as the REST All Report endpoint; get_bounce_report returns the same shape as the REST Bounce Report endpoint.

Send email endpoint

URL: https://app.smtpprovider.com/api/send-mail/

Fields

FieldTypeDescriptionRequired
tostringEmail address of the recipient.Y
fromstringEmail address of the sender.Y
from_namestringName of the sender.Y
subjectstringSubject to send with the email.Y
bodystringHTML template of the email.Y
attachments[]FileAdd multiple rows with the same key for one or more attachments.N
tokenstringAPI token provided on the profile page.Y

PHP cURL example

PHP
$data = [
  'to' => 'test@example.com',
  'from' => 'info@example.com',
  'from_name' => 'test mail',
  'subject' => 'test mail subject',
  'body' => 'Dear Admin, I want to know some points',
  'token' => '***********************',
];
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => 'https://app.smtpprovider.com/api/send-mail',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
]);
$response = curl_exec($curl);
if (curl_errno($curl)) echo 'Request Error:' . curl_error($curl);
curl_close($curl);
echo $response;

Responses

Success response

JSON
{
  "success": 1,
  "message_id": "mid-5739b9aa57df91a117476d030d38246c@akoneseo.com"
}

Error response

JSON
{
  "success": false,
  "data": { "message": "User Not Exist." }
}

Email Report

Method: GET

URL: https://app.smtpprovider.com/api/transaction-report

Returns paginated transactional email delivery records for the authenticated user. Results are ordered from newest to oldest.

Query Parameters

ParameterTypeDescriptionRequired
tokenstringAPI token provided on the profile page.Yes
from_datedateOptional start date/time filter.No
to_datedateOptional end date/time filter. A date-only value includes the complete day.No
pageintegerPage number. Minimum 1; default is 1.No
per_pageintegerRecords per page. Range 1–100; default is 100.No

PHP cURL Example

PHP

$query = http_build_query([
  'token' => 'API token provided on the profile page',
  'from_date' => '2026-01-01',
  'to_date' => '2026-01-31',
  'page' => 1,
  'per_page' => 100,
]);

$curl = curl_init("https://app.smtpprovider.com/api/transaction-report?$query");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Success Response

JSON
{
  "success": true,
  "data": {
    "current_page": 1,
    "per_page": 100,
    "total": 245,
    "last_page": 3,
    "from": 1,
    "to": 100,
    "has_more_pages": true,
    "data": [
      {
        "id": 12345,
        "time": "2026-01-31 12:30:00",
        "from_address": "info@example.com",
        "recipient": "user@example.com",
        "message_id": "message-id@example.com",
        "status": "send",
        "bounce_reason": null,
        "bounce_at": null,
        "bounce_cat": null
      }
    ]
  }
}

Error Responses

  • 422: Validation failed.
  • 403: Invalid API token.

PHP cURL example with attachments

PHP
$data = [
  'to' => 'test@example.com',
  'from' => 'info@example.com',
  'from_name' => 'test mail',
  'subject' => 'test mail subject',
  'body' => 'Dear Admin, I want to know some points',
  'attachments[]' => 'Attach file one',
  'attachments[]' => 'Attach file two',
  'token' => '***********************',
];
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => 'https://app.smtpprovider.com/api/send-mail',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data,
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Bounce Report

Method: GET

URL: https://app.smtpprovider.com/api/bounce-report

Returns paginated bounced email records for the authenticated user. Results are ordered from newest to oldest.

Query Parameters

ParameterTypeDescriptionRequired
tokenstringAPI token provided on the profile page.Yes
from_datedateOptional start date/time filter.No
to_datedateOptional end date/time filter. A date-only value includes the complete day.No
pageintegerPage number. Minimum 1; default is 1.No
per_pageintegerRecords per page. Range 1–100; default is 100.No

PHP cURL Example

PHP
$query = http_build_query([
  'token' => 'API_TOKEN',
  'from_date' => '2026-01-01',
  'to_date' => '2026-01-31',
  'page' => 1,
  'per_page' => 100,
]);

$curl = curl_init("https://app.smtpprovider.com/api/bounce-report?$query");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Returned Record Fields

  • id, time, from_address, recipient, and message_id
  • status, bounce_reason, bounce_at, and bounce_cat

Response Pagination Fields

The response includes current_page, per_page, total, last_page, from, to, has_more_pages, and a data array.

Error Responses

  • 422: Validation failed.
  • 403: Invalid API token.

Generate DKIM / SPF / DMARC

Method: POST

URL: https://app.smtpprovider.com/api/domain-keygenerate

Generates a DKIM key pair for a sender domain and returns the SPF, DKIM and DMARC details required to configure DNS for that domain.

Before you begin: check whether a DMARC TXT record already exists for the sender domain using the host name _dmarc — for example, search _dmarc.example.com as a TXT record on a tool such as dnschecker.org. If no record is found, add one after generating the keys below.

Parameters

ParameterTypeDescriptionRequired
api_keystringAPI token provided on the profile page.Y
domain_namestringSender domain to generate the DKIM key pair for.Y
is_add_existing_spfbooleanMerge the domain's existing SPF record with the newly generated one. Set to 1 to include the existing SPF record, or 0 to omit it.Y

PHP cURL Example

PHP
$query = http_build_query([
  'api_key' => 'API_TOKEN',
  'domain_name' => 'example.com',
  'is_add_existing_spf' => 0,
]);

$curl = curl_init("https://app.smtpprovider.com/api/domain-keygenerate?$query");
curl_setopt_array($curl, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Success Response

JSON
{
  "success": true,
  "data": {
    "domain": {
      "host": "smtp._domainkey.example.com",
      "selector": "smtp",
      "private_key": "-----BEGIN PRIVATE KEY-----\n<private_key_contents>\n-----END PRIVATE KEY-----",
      "public_key": "v=DKIM1; h=sha256; k=rsa; p=<public_key_contents>",
      "status": "finished",
      "domain_name": "example.com",
      "updated_at": "2026-03-20 10:27:47",
      "created_at": "2026-03-20 10:27:47"
    }
  }
}

Error Responses

  • 422: Validation failed.
  • 403: Invalid API token.

View Domain Details

Method: GET

URL: https://app.smtpprovider.com/api/domain-keygenerate-view

Returns the DKIM, SPF and DMARC details previously generated for a sender domain.

Parameters

ParameterTypeDescriptionRequired
api_keystringAPI token provided on the profile page.Y
domain_namestringSender domain to look up.Y

PHP cURL Example

PHP
$query = http_build_query([
  'api_key' => 'API_TOKEN',
  'domain_name' => 'example.com',
]);

$curl = curl_init("https://app.smtpprovider.com/api/domain-keygenerate-view?$query");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Success Response

Returns the domain record in the same shape as the Generate DKIM / SPF / DMARC response above.

Error Responses

  • 422: Validation failed.
  • 403: Invalid API token.

List All Domains

Method: GET

URL: https://app.smtpprovider.com/api/all-domainlist

Returns the list of sender domains configured for the authenticated user.

Parameters

ParameterTypeDescriptionRequired
api_keystringAPI token provided on the profile page.Y

PHP cURL Example

PHP
$query = http_build_query([
  'api_key' => 'API_TOKEN',
]);

$curl = curl_init("https://app.smtpprovider.com/api/all-domainlist?$query");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Success Response

Returns an array of domain records, each in the same shape as the Generate DKIM / SPF / DMARC response above.

Error Responses

  • 422: Validation failed.
  • 403: Invalid API token.

SMTPProvider.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.