Send Email
Multiple ways to send. Pick the one that fits your stack.
Authentication
Every request needs a bearer token and the email:send permission. See Authentication for how to get one.
Send an email
curl -X POST https://api.mailverick.com/v1/send-email \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-d '{
"requests": [{
"from": { "email": "you@yourdomain.com" },
"to": [{ "email": "recipient@example.com" }],
"reply_to": { "email": "support@yourdomain.com" },
"subject": "Order confirmation #1234",
"body": {
"html": "<h1>Thank you!</h1><p>Your order has been confirmed.</p>",
"text": "Thank you! Your order has been confirmed."
},
"custom_id": "order-1234",
"tracking": { "opens": "last_only", "disabled": false }
}]
}' Request body
| Field | Type | Description |
|---|---|---|
requests | array | Array of email requests (batch), at least one |
requests[].from | object | email (required), name (optional, up to 64 characters) |
requests[].to | array | 1 to 50 recipients, each with email and optional name |
requests[].reply_to | object? | Address replies go to: email (required), name (optional). Sets the Reply-To header |
requests[].subject | string | Subject line, up to 998 characters |
requests[].body.html | string? | HTML content. Provide html, text, or both |
requests[].body.text | string? | Plain text content, also used as the fallback for HTML |
requests[].attachments | array? | Files attached to the email, each with file_name (up to 255 characters), content_type (for example application/pdf) and base64_content (the file, base64-encoded) |
requests[].inline_attachments | array? | Images embedded in the HTML: same fields as attachments, plus content_id (up to 255 printable ASCII characters, no spaces or angle brackets). Reference them in the HTML as <img src="cid:your-content-id"> |
requests[].custom_id | string? | Your identifier, up to 256 characters, returned in all events |
requests[].tracking | object? | opens: none, last_only, or full (open-tracking mode; defaults to your tenant setting). disabled: boolean, turns off open and click tracking for this email. |
The whole request body is limited to 20 MB, attachments included. Base64 encoding makes a file about a third larger than its original size.
Responses
A successful call returns 201 with an empty body: the batch is accepted and delivered asynchronously. Track what happens next with Email Events.
| Status | Code | When |
|---|---|---|
201 | Accepted for delivery. Empty body | |
400 | VALIDATION_ERROR | Malformed body, or a field failed validation |
401 | UNAUTHORIZED | Missing, malformed, or expired bearer token |
402 | ACCOUNT_PAYMENT_OVERDUE | The account has an unpaid invoice |
403 | FORBIDDEN | The service account lacks the email:send permission |
403 | ACCOUNT_SUSPENDED, TENANT_SUSPENDED | The account or tenant is suspended |
429 | MONTHLY_QUOTA_EXCEEDED, DAILY_QUOTA_EXCEEDED | The sending quota for the period is spent. Nothing in the batch was sent |
429 | RATE_LIMITED | Too many requests, or too many recent sends to one of the recipients |
500 | INTERNAL_ERROR | Something went wrong on our side |
Install
npm install @bytewise-solutions/mailverick Send an email
The SDK handles token exchange and refresh automatically. Pass your API key credentials and send. Use sendEmails to send several emails in one batch.
import { Mailverick } from "@bytewise-solutions/mailverick";
const client = new Mailverick("mvk_id_xxx", "mvk_sec_xxx");
await client.sendEmail({
from: { email: "you@yourdomain.com" },
to: [{ email: "recipient@example.com" }],
replyTo: { email: "support@yourdomain.com" },
subject: "Order confirmation #1234",
body: {
html: "<h1>Thank you!</h1>",
text: "Thank you! Your order has been confirmed.",
},
customId: "order-1234",
tracking: { opens: "last_only", disabled: false },
}); Parameters
| Parameter | Type | Description |
|---|---|---|
from | object | email (required), name (optional) |
to | array | 1 to 50 recipients, each with email and optional name |
replyTo | object? | Address replies go to: email (required), name (optional) |
subject | string | Subject line |
body.html | string? | HTML content. Provide html, text, or both |
body.text | string? | Plain text content |
attachments | array? | Files with fileName, contentType and base64Content |
inlineAttachments | array? | Same fields plus contentId, referenced in the HTML as cid:your-content-id |
customId | string? | Your identifier, returned in all events |
tracking | object? | opens: none, last_only, or full. disabled: boolean, turns off open and click tracking for this email. |
Configuration
No token needed. Authenticate directly with your API key credentials. Drop-in replacement for any SMTP configuration.
Use port 465, which encrypts the connection before any data is sent. Port 587 is also supported and upgrades to TLS with STARTTLS. Cleartext authentication is refused on both, so your client has to complete TLS before it authenticates.
| Setting | Value |
|---|---|
| Host | smtp.mailverick.com |
| Port | 465 preferred, or 587 |
| Security | Implicit TLS on 465, STARTTLS on 587 |
| Username | Your mvk_id_ API key ID |
| Password | Your mvk_sec_ API key secret |
Framework examples
SMTP_HOST=smtp.mailverick.com
# Use 587 with STARTTLS, or 465 with implicit TLS. Cleartext auth is refused.
# Django and Spring need their TLS setting enabled explicitly.
SMTP_PORT=587
SMTP_USER=mvk_id_xxxxxxxxxx
SMTP_PASS=mvk_sec_xxxxxxxxxx const nodemailer = require("nodemailer");
const transporter = nodemailer.createTransport({
host: "smtp.mailverick.com",
port: 465,
secure: true,
auth: {
user: "mvk_id_xxxxxxxxxx",
pass: "mvk_sec_xxxxxxxxxx",
},
});
await transporter.sendMail({
from: "you@yourdomain.com",
to: "recipient@example.com",
subject: "Order confirmation #1234",
html: "<h1>Thank you!</h1>",
}); # settings.py
EMAIL_HOST = "smtp.mailverick.com"
EMAIL_PORT = 465
EMAIL_HOST_USER = "mvk_id_xxxxxxxxxx"
EMAIL_HOST_PASSWORD = "mvk_sec_xxxxxxxxxx"
EMAIL_USE_SSL = True # .env
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailverick.com
MAIL_PORT=465
MAIL_USERNAME=mvk_id_xxxxxxxxxx
MAIL_PASSWORD=mvk_sec_xxxxxxxxxx
MAIL_ENCRYPTION=ssl # application.properties
spring.mail.host=smtp.mailverick.com
spring.mail.port=465
spring.mail.username=mvk_id_xxxxxxxxxx
spring.mail.password=mvk_sec_xxxxxxxxxx
spring.mail.properties.mail.smtp.ssl.enable=true What's next
Now that you can send emails, learn how to track what happens after delivery with Email Events: delivery status, bounces, opens, clicks, and spam reports in real time.