Email Service API
The Sendlix Email Service API provides a powerful, developer-friendly solution for sending transactional and marketing emails programmatically. With support for multiple email formats, comprehensive tracking, and seamless integration, it delivers everything you need for reliable email communication.
Core Email API Features
- 🚀 High-Performance Delivery: Enterprise-grade infrastructure ensuring 99.9% email deliverability
- 📧 Multiple Email Formats: Support for HTML, plain text, and raw EML format with full header control
- 📊 Real-Time Tracking: Monitor opens, clicks, bounces, and delivery status with detailed analytics
- 👥 Group Management: Send bulk emails to predefined recipient lists efficiently
- 🔧 Easy API Integration: RESTful API with comprehensive SDKs for popular programming languages
- 📚 Developer-First Documentation: Complete guides, examples, and best practices for quick implementation
Quick Start Guide
Get started with the Sendlix Email Service API in minutes:
- Create Account: Sign up for free at Sendlix
- Domain Setup: Add your sending domain for better deliverability
- Domain Verification: Verify domain ownership via DNS records
- API Key: Generate your API key from the dashboard
- SDK Installation: Install our official client library for your language
- Send First Email: Start sending emails with our simple API
- cURL
- Node.js
Install cURL on your system. Installation instructions for various operating systems can be found here.
This guide may not always reflect the most recent updates. While we strive to keep it current, the API is continuously evolving. For the most accurate and detailed information on using the Email Service, refer to the API Reference.
To install the Sendlix Node.js client library, execute the following command in your terminal:
npm install sendlix
Scopes
The Email Service requires the following scopes to be set in your API key:
sender
: Allows sending emails.group.sender
: Allows sending emails to groups.
Email Functions
Sending Standard Emails
Send simple, formatted emails with HTML or text content to one or more recipients.
- cURL
- Node.js
To send an email using our REST API, use the following cURL command. For detailed API usage information, see the Sendlix REST API Documentation or use our interactive cURL Builder.
curl -X POST https://api.sendlix.com/v1/send/email \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"to": [
{
"email": "recipient@example.com",
"name": "Recipient Name"
}
],
"from": {
"email": "sender@example.com",
"name": "Sender Name"
},
"subject": "Welcome to Sendlix",
"textContent": {
"html": "<h1>Welcome!</h1><p>This is a test email.</p>",
"tracking": true
}
}'
To send an email using our Node.js client library, first install the library:
npm install sendlix
For comprehensive information on using Node.js and configuring the client, see the Sendlix Node.js Client Documentation.
Here's an example of sending an email with the Sendlix Node.js client library:
import { EmailClient } from "sendlix";
// Initialize client
const client = new EmailClient("sk_xxxxxxxxx.xxx");
// Email configuration
const sendMail = {
from: { email: "sender@example.com", name: "Sender Name" },
to: [{ email: "recipient@example.com", name: "Recipient Name" }],
subject: "Welcome to Sendlix!",
html: "<h1>Welcome!</h1><p>This is a test email.</p>",
tracking: true, // Enable tracking
};
// Send email
client
.sendEmail(sendMail)
.then((response) => {
console.log("Email sent:", response);
})
.catch((error) => {
console.error("Error sending email:", error);
});
Sending EML Emails
Send complete emails with all headers and complex content using the EML format.
- cURL
- Node.js
To send an EML email using our REST API, use the following command. For detailed API usage information, see the Sendlix REST API Documentation.
curl -X POST https://api.sendlix.com/v1/send/eml \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"mail": "Base64-encoded EML content"
}'
The EML content must be encoded as a Base64 string. You can encode an EML file using the following command:
base64 -i email.eml
To send an EML email using our Node.js client library:
import { EmailClient } from "sendlix";
import fs from "fs";
// Initialize client
const client = new EmailClient("YOUR_API_KEY");
// Send EML file
const sendEmlFromFile = async () => {
try {
const response = await client.sendEmlEmail("path/to/email.eml");
console.log("EML email sent:", response);
} catch (error) {
console.error("Error sending EML email:", error);
}
};
// Or with a buffer
const sendEmlFromBuffer = async () => {
try {
const emlBuffer = fs.readFileSync("path/to/email.eml");
const response = await client.sendEmlEmail(emlBuffer);
console.log("EML email sent:", response);
} catch (error) {
console.error("Error sending EML email:", error);
}
};
Sending Group Emails
Send emails to predefined recipient groups to simplify the management of large mailing lists.
- cURL
- Node.js
curl -X POST https://api.sendlix.com/v1/send/group/{group_id} \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"subject": "Important Announcement for the Group",
"textContent": {
"html": "<h1>Hello Group!</h1><p>This is an important announcement for all group members.</p>",
"text": "Hello Group! This is an important announcement for all group members.",
"tracking": true
},
"from": {
"email": "sender@example.com",
"name": "Group Administrator"
}
}'
Replace {group_id}
with the ID of your predefined group. You can manage groups in the Sendlix dashboard.
import { EmailClient } from "sendlix";
// Initialize client
const client = new EmailClient("YOUR_API_KEY");
// Send group email
const sendGroupEmail = async () => {
try {
const response = await client.sendGroupEmail({
from: { email: "sender@example.com", name: "Sender Name" },
groupId: "group-123",
subject: "Group Announcement",
html: "<h1>Hello Group!</h1><p>This is a group email.</p>",
text: "Hello Group! This is a group email.",
tracking: true,
});
console.log("Group email sent:", response);
} catch (error) {
console.error("Error sending group email:", error);
}
};
// Call the function to send the group email
sendGroupEmail();
You can manage and create groups through the Sendlix dashboard or API.
Advanced Features
For more information on the advanced features of the Email Service, please consult the API Reference.
- cURL
- Node.js
For more information on advanced features, see the Sendlix API Documentation.
For more information on advanced features, see the Sendlix Node.js Client Documentation.