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.
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.
The Dashboard is your control center, offering a high-level overview of your email ecosystem.
What You Can Do:
Hover over each section for real-time metrics and quick insights. |
The Team section enables you to collaborate with others while maintaining control over access and security.
What You Can Do:
Use this section to build a secure and productive team workflow. |
The Keys section allows you to create, manage, and secure API keys used for programmatic email sending.
What You Can Do:
Keys must be tied to a verified domain to function. Always store keys securely and follow best practices for API security. |
The Domain section is where you register and verify sending domains for secure and authenticated email delivery.
What You Can Do:
Domain verification is mandatory to ensure your emails are delivered and not marked as spam. |
The Send Mail feature allows you to test your domain and configuration by sending a real email.
What You Can Do:
This is especially helpful to confirm successful domain setup before going live. |
The Mail Logs section is your historical record of all emails sent from your account.
What You Can Do:
Use this section for debugging, auditing, and performance analysis. |
The Email Hosting section allows you to manage mailbox services linked to your domain.
What You Can Do:
Ideal for teams or businesses that want branded email addresses without using third-party providers. |
The Support Ticket section is your direct line to our customer support team.
What You Can Do:
Our support team is committed to helping you resolve issues promptly and efficiently. |
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 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.
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);
});
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:
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.
200 | Email Sent Successfully | Your email has been sent successfully and has been accepted by Mailcub for delivery. |
101 | Your 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. |
102 | Your account is suspended. Please contact support. | The account has been suspended, often due to policy violations or extended inactivity. Contact support for reactivation. |
400 | Bad Request | email_from must be a valid email |
401 | Request Unauthorized | The request was rejected due to a missing or invalid secret key. Check your credentials. |
403 | Domain not verified. | The domain exists but has not completed the verification process. Verify the domain before sending emails. |
404 | Domain not found. | The specified domain does not exist in your Mailcub account. Add the domain to your dashboard. |
429 | You 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. |