Introduction
    Guidelines
    Authentication
    MailCub SDK
    Error Codes & Responses

Introduction

Welcome to the official documentation for Mailcub, a powerful and developer-friendly email service designed to simplify the process of sending transactional and marketing emails. With Mailcub, you can easily integrate email functionality into your applications using our simple package, monitor delivery in real-time, and gain insights through detailed analytics. Whether you're a solo developer, a startup, or an enterprise team, Mailcub provides the tools you need for reliable email delivery, domain verification, and bounce handling—all in one secure and scalable platform. This documentation will guide you through setup, integration, and best practices to help you make the most of Mailcub.

Guidelines

This section provides actionable guidance on how to use each area of your dashboard effectively. Whether you're managing domains, sending emails, or reviewing logs, each topic below offers best practices and key features to help you succeed.

Dashboard

The Dashboard is your control center, offering a high-level overview of your email ecosystem.

What You Can Do:

  • Monitor Account Health: Instantly see if your account is in good standing, with alerts for quota limits or configuration issues.
  • View API Usage: Track how many emails have been sent using each API key, including usage trends and rate limits.
  • Domain Summary: Check the verification status of all connected domains and their activity.
  • Email Delivery Stats:
    • Emails Sent: Number of emails sent today, this week, or custom periods.
    • Bounce Rate: Track the percentage of emails that were not delivered.
    • Open & Click Rates: Understand recipient engagement.
    • Deferred & Failed Deliveries: Identify issues affecting deliverability.
⚠️ IMPORTANT:
Hover over each section for real-time metrics and quick insights.

Team Management

The Team section enables you to collaborate with others while maintaining control over access and security.

What You Can Do:

  • Invite Members: Send email invitations to team members to join your workspace.
  • Assign Roles: Choose from predefined roles:
    • Admin: Full access to all settings and data.
    • Developer: Can manage API keys, domains, and integration tasks.
    • Marketer: Can create and send campaigns, view logs, and performance.
  • Set Permissions: Control what each member can access and modify (e.g., domains, billing, settings).
⚠️ IMPORTANT:
Use this section to build a secure and productive team workflow.

API Keys

The Keys section allows you to create, manage, and secure API keys used for programmatic email sending.

What You Can Do:

  • Create New Keys: Generate keys after verifying your domain.
  • Define Scope: Choose the access level each key has—read-only, send-only, or full access.
  • Key Rotation: Revoke and regenerate keys for improved security.
  • Track Key Activity: See usage logs and error reports for each API key.
⚠️ IMPORTANT:
Keys must be tied to a verified domain to function. Always store keys securely and follow best practices for API security.

Domain Management

The Domain section is where you register and verify sending domains for secure and authenticated email delivery.

What You Can Do:

  • Add Domains: Enter your domain name to initiate verification.
  • Configure DNS Records: Add required records like:
    • SPF – Proves you're allowed to send emails from your domain.
    • DKIM – Signs emails to prevent tampering.
    • DMARC – Instructs recipients on how to handle unauthenticated messages.
  • Check Verification Status: See real-time updates on whether records are correct.
⚠️ IMPORTANT:
Domain verification is mandatory to ensure your emails are delivered and not marked as spam.

Send Mail (Test Feature)

The Send Mail feature allows you to test your domain and configuration by sending a real email.

What You Can Do:

  • Choose a Verified Domain: Select which domain to send from.
  • Send to Any Recipient: Enter a destination email to verify delivery.
  • Add Subject & Message Body: Compose a real test message.
  • Receive Feedback: Check whether the email was delivered, bounced, or deferred.
⚠️ IMPORTANT:
This is especially helpful to confirm successful domain setup before going live.

Mail Logs

The Mail Logs section is your historical record of all emails sent from your account.

What You Can Do:

  • Search & Filter Logs: By date, recipient, domain, status, or subject.
  • View Email Statuses:
    • Sent: Successfully delivered.
    • Bounced: Delivery failed (permanent or temporary).
    • Deferred: Delivery delayed, often due to recipient server.
    • Opened: Recipient opened the email (requires open tracking).
    • Unsubscribed: User opted out of future emails.
  • Access Detailed Metadata: View timestamp, response from the email server, and sending method.
⚠️ IMPORTANT:
Use this section for debugging, auditing, and performance analysis.

Email Hosting

The Email Hosting section allows you to manage mailbox services linked to your domain.

What You Can Do:

  • Create Mailboxes: e.g., info@yourdomain.com, support@yourdomain.com.
  • Access Hosting URL: Use provided credentials and login to the webmail interface.
  • Track Status: Check the mailbox’s storage, health, and setup details.
  • Domain Association: Ensure your domain is verified to use mailbox features.
⚠️ IMPORTANT:
Ideal for teams or businesses that want branded email addresses without using third-party providers.

Support Ticket System

The Support Ticket section is your direct line to our customer support team.

What You Can Do:

  • Submit a Ticket: Describe your issue in detail, attach screenshots if needed.
  • Track Ticket Status: Monitor the progress of your requests (Open, Under Review, Resolved).
  • Communicate with Support: Receive and reply to responses directly within your dashboard.
⚠️ IMPORTANT:
Our support team is committed to helping you resolve issues promptly and efficiently.

Authentication

To send emails using Mailcub, you need to authenticate your request using a secret key. This key verifies that the request is coming from an authorized user.

MailCub SDK

Mailcub SDK is a lightweight and developer-friendly client library for integrating Mailcub’s email delivery service into your applications. Designed to simplify the process of sending transactional and marketing emails, the SDK helps you send messages, handle attachments, and track delivery—securely and efficiently.

Installation

Quick Start


const mailcub = require('mailcub');

const emailBody = {
  email_from: 'user@yourdomain.com',
  receiver: 'user@example.com',
  subject: 'Subject',
  html: '<h1>Hello</h1>', // You can also use 'text' instead of 'html'
  attachment: 'attachment_path' // Optional
};

const secretKey = 'your-secret-key';

mailcub.sendMail(emailBody, secretKey)
  .then(() => {
    console.log('Email sent successfully');
  })
  .catch((error) => {
    console.error('Error sending email:', error);
  });

Error Codes & Responses

When using the Mailcub API or SDKs, you may receive various response codes indicating the success or failure of your request. Understanding these codes is essential for implementing proper error handling in your application. Mailcub uses a combination of standard HTTP status codes and custom application-level codes to give clear and actionable feedback for each request.

These status codes help developers quickly identify the nature of any issue and respond accordingly. Whether it's a successful delivery, a paused account, or a missing verification, each code points to a specific condition that affects email transmission or account activity.

Standard HTTP status codes such as 200, 401, and 404 follow common web conventions, making them instantly recognizable for most developers. On the other hand, Mailcub-specific codes like 101 or 102 provide deeper insight into account-specific conditions such as suspension or quota limits.

Properly handling these responses in your application allows you to display meaningful messages to users, automate recovery mechanisms, or alert your technical team when critical issues occur. For example, when a 429 (Rate Limit Exceeded) is received, your app can pause and retry later, rather than failing silently.

Below is a summary of common status codes you may encounter. This reference should help you implement logic for:

  • Validating if emails were sent successfully
  • Checking if user credentials or keys are expired or invalid
  • Identifying account issues such as pause or suspension
  • Monitoring sending limits and taking proactive action
  • Ensuring your domain is properly verified before sending emails

Mailcub's focus is to ensure high deliverability and platform security. Understanding and responding to these codes correctly will result in a smoother developer experience and fewer delivery disruptions.

HTTP Status Code Summary
200Email Sent SuccessfullyYour email has been sent successfully and has been accepted by Mailcub for delivery.
101Your account is paused. Please contact support.Your account is currently paused, possibly due to inactivity or billing issues. Reach out to support to resume service.
102Your account is suspended. Please contact support.The account has been suspended, often due to policy violations or extended inactivity. Contact support for reactivation.
400Bad Requestemail_from must be a valid email
401Request UnauthorizedThe request was rejected due to a missing or invalid secret key. Check your credentials.
403Domain not verified.The domain exists but has not completed the verification process. Verify the domain before sending emails.
404Domain not found.The specified domain does not exist in your Mailcub account. Add the domain to your dashboard.
429You have exceeded your email limit. Please upgrade your plan.You’ve hit your monthly or daily sending limit. Upgrade your plan to increase your quota.