Email and SMS Sending Service via API and SMTP

The API & SMTP for SaaS, E-commerce & Developers

Send Email SMS by API

Integrate Email and SMS Sending via RESTful API

API by developers, for developers

Integrating our API into your product is easy and quick. With our robust RESTful APIs, the integration of notifications is straightforward, whether you’re sending transactional emails, sms or bulk messages.

  • Curl
  • Python
  • Go
  • PHP
  • NodeJS
  • Ruby
  • C#
  • Java
  • PowerShell
curl -L -X POST 'https://api.sweego.io/send' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Api-Key: <API_KEY_VALUE>' \
--data-raw '{
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": false,
  "headers": {}
}'
import requests
import json

url = "https://api.sweego.io/send"

payload = json.dumps({
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": False,
  "headers": {}
})
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Api-Key': '<API_KEY_VALUE>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.sweego.io/send"
  method := "POST"

  payload := strings.NewReader(`{
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": false,
  "headers": {}
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("Accept", "application/json")
  req.Header.Add("Api-Key", "<API_KEY_VALUE>")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.sweego.io/send',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": false,
  "headers": {}
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Accept: application/json',
    'Api-Key: <API_KEY_VALUE>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
const https = require('follow-redirects').https;
const fs = require('fs');

let options = {
  'method': 'POST',
  'hostname': 'api.sweego.io',
  'path': '/send',
  'headers': {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Api-Key': '<API_KEY_VALUE>'
  },
  'maxRedirects': 20
};

const req = https.request(options, (res) => {
  let chunks = [];

  res.on("data", (chunk) => {
    chunks.push(chunk);
  });

  res.on("end", (chunk) => {
    let body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", (error) => {
    console.error(error);
  });
});

let postData = JSON.stringify({
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": false,
  "headers": {}
});

req.write(postData);

req.end();
require "uri"
require "json"
require "net/http"

url = URI("https://api.sweego.io/send")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request["Api-Key"] = "<API_KEY_VALUE>"
request.body = JSON.dump({
  "campaign-id": "string",
  "channel": "email",
  "provider": "string",
  "recipients": [
    {
      "email": "user@example.com",
      "name": "string"
    }
  ],
  "from": {
    "email": "user@example.com",
    "name": "string"
  },
  "subject": "string",
  "message-txt": "string",
  "message-html": "string",
  "template-id": "string",
  "variables": {},
  "campaign-tag": "string",
  "campaign-type": "market",
  "dry-run": false,
  "headers": {}
})

response = https.request(request)
puts response.read_body
var options = new RestClientOptions("")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("https://api.sweego.io/send", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
request.AddHeader("Api-Key", "<API_KEY_VALUE>");
var body = @"{" + "\n" +
@"  ""campaign-id"": ""string""," + "\n" +
@"  ""channel"": ""email""," + "\n" +
@"  ""provider"": ""string""," + "\n" +
@"  ""recipients"": [" + "\n" +
@"    {" + "\n" +
@"      ""email"": ""user@example.com""," + "\n" +
@"      ""name"": ""string""" + "\n" +
@"    }" + "\n" +
@"  ]," + "\n" +
@"  ""from"": {" + "\n" +
@"    ""email"": ""user@example.com""," + "\n" +
@"    ""name"": ""string""" + "\n" +
@"  }," + "\n" +
@"  ""subject"": ""string""," + "\n" +
@"  ""message-txt"": ""string""," + "\n" +
@"  ""message-html"": ""string""," + "\n" +
@"  ""template-id"": ""string""," + "\n" +
@"  ""variables"": {}," + "\n" +
@"  ""campaign-tag"": ""string""," + "\n" +
@"  ""campaign-type"": ""market""," + "\n" +
@"  ""dry-run"": false," + "\n" +
@"  ""headers"": {}" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"campaign-id\": \"string\",\n  \"channel\": \"email\",\n  \"provider\": \"string\",\n  \"recipients\": [\n    {\n      \"email\": \"user@example.com\",\n      \"name\": \"string\"\n    }\n  ],\n  \"from\": {\n    \"email\": \"user@example.com\",\n    \"name\": \"string\"\n  },\n  \"subject\": \"string\",\n  \"message-txt\": \"string\",\n  \"message-html\": \"string\",\n  \"template-id\": \"string\",\n  \"variables\": {},\n  \"campaign-tag\": \"string\",\n  \"campaign-type\": \"market\",\n  \"dry-run\": false,\n  \"headers\": {}\n}");
Request request = new Request.Builder()
  .url("https://api.sweego.io/send")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Accept", "application/json")
  .addHeader("Api-Key", "<API_KEY_VALUE>")
  .build();
Response response = client.newCall(request).execute();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Api-Key", "<API_KEY_VALUE>")

$body = @"
{
  `"campaign-id`": `"string`",
  `"channel`": `"email`",
  `"provider`": `"string`",
  `"recipients`": [
    {
      `"email`": `"user@example.com`",
      `"name`": `"string`"
    }
  ],
  `"from`": {
    `"email`": `"user@example.com`",
    `"name`": `"string`"
  },
  `"subject`": `"string`",
  `"message-txt`": `"string`",
  `"message-html`": `"string`",
  `"template-id`": `"string`",
  `"variables`": {},
  `"campaign-tag`": `"string`",
  `"campaign-type`": `"market`",
  `"dry-run`": false,
  `"headers`": {}
}
"@

$response = Invoke-RestMethod 'https://api.sweego.io/send' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json

Not enough time to implement API? Quickly Start Sending emails via SMTP Service

For those who prefer SMTP, Sweego offers a compatible solution that easily integrates with your existing tools. Send your emails from your application or CRM without changing your environment, while benefiting from advanced statistical tracking.

Host, port, login and password is the only information you need to send email by SMTP

smtp parameters

Our features for your notifications

scalability icon

Scalability

Send your emails or SMS messages via API or SMTP as soon as your account is validated.

email authentication

Security & Compliance

SPF/DKIM enabled upon installation, management of confidential mailings, and custom log tracking

email builder icon

Email builder

Use our integrated email builder to create emails templates and send beautiful and compatible emails

customized headers

Custom Header

Add customized headers to supercharge your statistics & logs

Sweego Laptop

Statistics & Webhook

Track history, open rates, and configure webhooks to automate reporting.

Sweego Envelop

Test Mode

Test your email flow without sending your email to a real address

How can I send emails via API with Sweego?

Sweego provides a simple, fast, and secure RESTful API to send transactional or marketing emails. Our API is designed for developers and integrates seamlessly with your applications.

🔗 View the full API documentation

How do I set up email sending via SMTP with Sweego?

If you prefer using SMTP, Sweego offers a compatible solution that integrates easily with your existing tools (CRM, applications, etc.). Just configure your application with the SMTP credentials provided in your Sweego dashboard (host, port, login, password).

💡 Benefits:

  • Instant integration with your current tools.
  • Access to advanced statistics and email tracking.

How can I send SMS via API with Sweego?

Sending SMS via API is as easy as sending emails. Use the same /send endpoint, but set the "channel" parameter to "sms". Specify the recipient’s phone number and the SMS content.

📌 Use Cases:

  • Transactional notifications (OTP, confirmations).
  • Real-time alerts.
  • Appointment confirmation

What are the benefits of using Sweego’s email API service?

Sweego offers a scalable, secure, and optimized solution for developers and product managers:

  • Quick integration: RESTful API with clear documentation.
  • Automatic authentication: SPF, DKIM, and domain management included.
  • Real-time tracking: Detailed statistics (open rates, clicks, etc.).
  • Customizable templates: Create compatible emails with our built-in email builder.
  • Webhooks: Automate workflows with real-time notifications.

🔍 Why choose Sweego?

  • Responsive support: Dedicated assistance for developers.
  • No volume limits: Send thousands or millions of emails or SMS without restrictions.

Is Sweego compatible with popular frameworks and programming languages?

Yes! Sweego provides ready-to-use code examples for popular languages and frameworks:

  • Python, Node.js, PHP, Go, Ruby, C#, Java, PowerShell
  • HTTP libraries (cURL, Axios, Fetch, etc.)

📚 Resources:

How can I test email sending without sending to real recipients?

Sweego offers a test mode to validate your integrations without risk:

  • Enable the "dry-run": true parameter in your API request.
  • Your emails will be validated but not sent to the final recipients.

🔧 Ideal for:

  • Continuous integration testing (CI/CD).
  • Development phases.

What are the best practices for optimizing email deliverability with Sweego?

To maximize email deliverability:

  • Authenticate your domain: Set up SPF, DKIM, and DMARC.
  • Use optimized templates: Avoid spammy keywords and test mobile rendering.
  • Segment your lists: Send targeted emails to improve engagement.
  • Monitor statistics: Use Sweego’s reports to adjust your campaigns.

📈 Sweego Tools for Deliverability:

Can I send bulk emails with Sweego?

Yes, Sweego is fully equipped to handle bulk email sending for both transactional and marketing purposes. Our platform is optimized for high-volume sending, ensuring reliability and speed.

Optimized API for high volumes: Send thousands of emails efficiently with minimal latency.
Dynamic personalization: Use custom variables to personalize each email for your recipients.
Seamless integration: Connect Sweego’s API with your existing contact management system or CRM.

📊 Use Cases:

  • Newsletters: Keep your audience engaged with regular updates.
  • Promotional campaigns: Drive conversions with targeted offers.
  • Automated notifications: Send reminders, alerts, or transactional messages (e.g., abandoned cart notifications).

💡 Note: Sweego focuses on email delivery and API integration. For contact management, you can integrate Sweego with your preferred CRM or database system