translate Englishattach_moneyUSDQuick AI Login
emoji_food_beverage Exploreinterests Pigment Libraryattach_email Mail Enginesms Celular Textlocal_library API Docs

Mailpress SMTP Mail Engine API Documentation

You have a killer email marketing campaign locked and loaded. Now, how to send it to the 2000 or 2 million email addresses on your contact list? For most marketers, an email service provider (ESP) is the answer to reliably and effectively delivering mass email without the hassle or costs of trying to do it yourself. ESPs often provide email marketing software that helps you manage and deliver your messages. However, using an email service doesn't mean you'll break the bank sending content to your subscribers. We offer comprehensive deliverability features and powerful marketing automation tools without breaking local laws.

Below are the endpoints for accessing On-Demand Mail Engine. Learn how to integrate the API into your application.

Authorization:

  • privateId *Specify privateId for site
    (e.g., "Bearer example^com-SomeIdString").

Query Parameters:

  • type Specify type of SES
    for Transactional OTP (e.g., type:"OTP").
    for Promotional Bulk (e.g., type:"TMP").
    for Informational personalized (e.g., type:"CXT").

Body Parameters:

  • mailId Specify the array of mail address
    (e.g., ["email@domain.com"]).
  • :data Specify the mail OTP|TMP|CXT string
    for Transactional OTP (e.g., OTP:"000000").
    for Promotional Bulk (e.g., TMP:"template-id-here").
    for Informational personalized (e.g., CXT:"html-email").

Route Parameters:

  • :region *Please check location table here
    (e.g., "WEST_3|ARAB_1|EAST_3|NORD_6").

Response based on params:

{
  "success": true,
  "info": "SES OTP Sent!"
}

POST

check_boxNoAuthcheck_box_outline_blankLoyaltycheck_box_outline_blankEnterprise

This endpoint provides the mail for sending bulk email.

JavaScript
Python
Php
Java
c#
Ruby
Go
Swift
require 'net/http'
require 'uri'
require 'json'

def fetch_data
  # API configuration
  base_url = 'https://mailpress.api.koirang.com/v1/:region'
  params = {
    'region' => 'YOUR_REGION'  # Replace with actual region value
  }
  headers = {
    'Content-Type' => 'application/json',
    'Authorization' => "Bearer <privateId>"
  }
  query_params = {"mailId":"example@domain.com","OTP":"000000"}
  
  begin
    # Build URL
    url = base_url
    ["region"].each do |param|
      url += "/#{URI.encode_www_form_component(params[param])}"
    end
    
    # Add query parameters
    uri = URI(url)
    uri.query = URI.encode_www_form(query_params)
    
    # Create HTTP client
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = uri.scheme == 'https'
    
    # Create request
    request = case 'GET'
             when 'POST'
               Net::HTTP::Post.new(uri)
             when 'PUT'
               Net::HTTP::Put.new(uri)
             when 'DELETE'
               Net::HTTP::Delete.new(uri)
             else
               Net::HTTP::Get.new(uri)
             end
    
    # Set headers
    headers.each { |key, value| request[key] = value }
    
    # Set body for POST/PUT requests
    if ['POST', 'PUT'].include?('GET')
      request.body = {"type":"OTP"}.to_json
    end
    
    # Send request
    response = http.request(request)
    
    # Check for errors
    unless response.is_a?(Net::HTTPSuccess)
      raise "HTTP error! status: #{response.code}"
    end
    
    JSON.parse(response.body)
  rescue StandardError => e
    puts "Error: #{e.message}"
    nil
  end
end

# Example usage
result = fetch_data
puts JSON.pretty_generate(result) if result