Send Email

Multiple ways to send. Pick the one that fits your stack.

Authentication

Exchange your API key credentials for a JWT token. Tokens are valid for 1 hour.

curl -X POST https://api.mailverick.com/v1/token \
  -H "Content-Type: application/json" \
  -d '{
    "api_key_id": "mvk_key_xxxxxxxxxx",
    "api_key_secret": "mvk_sec_xxxxxxxxxx"
  }'
{
  "access_token": "eyJhbGciOi...",
  "expires_in": 3600,
  "token_type": "Bearer"
}

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" }],
      "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

FieldTypeDescription
requestsarrayArray of email requests (batch)
requests[].fromobjectemail (required), name (optional)
requests[].toarrayRecipients with email and optional name
requests[].subjectstringSubject line
requests[].body.htmlstringHTML content
requests[].body.textstring?Plain text fallback
requests[].custom_idstring?Your identifier, returned in all events
requests[].trackingobject?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.

Install

npm install @bytewise-solutions/mailverick

Send an email

The SDK handles token exchange and refresh automatically. Pass your API key credentials and send.

import { Mailverick } from "@bytewise-solutions/mailverick";

const client = new Mailverick("mvk_key_xxx", "mvk_sec_xxx");

await client.sendEmail({
  from: { email: "you@yourdomain.com" },
  to: [{ email: "recipient@example.com" }],
  subject: "Order confirmation #1234",
  body: {
    html: "<h1>Thank you!</h1>",
    text: "Thank you! Your order has been confirmed.",
  },
  custom_id: "order-1234",
  tracking: { opens: "last_only", disabled: false },
});

Parameters

ParameterTypeDescription
fromobjectemail (required), name (optional)
toarrayRecipients with email and optional name
subjectstringSubject line
body.htmlstringHTML content
body.textstring?Plain text fallback
custom_idstring?Your identifier, returned in all events
trackingobject?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.

SettingValue
Hostsmtp-in.mailverick.com
Port25
SecuritySTARTTLS
UsernameYour mvk_key_ API key ID
PasswordYour mvk_sec_ API key secret

Framework examples

SMTP_HOST=smtp-in.mailverick.com
SMTP_PORT=25
SMTP_USER=mvk_key_xxxxxxxxxx
SMTP_PASS=mvk_sec_xxxxxxxxxx
const nodemailer = require("nodemailer");

const transporter = nodemailer.createTransport({
  host: "smtp-in.mailverick.com",
  port: 25,
  auth: {
    user: "mvk_key_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-in.mailverick.com"
EMAIL_PORT = 25
EMAIL_HOST_USER = "mvk_key_xxxxxxxxxx"
EMAIL_HOST_PASSWORD = "mvk_sec_xxxxxxxxxx"
EMAIL_USE_TLS = True
# .env
MAIL_MAILER=smtp
MAIL_HOST=smtp-in.mailverick.com
MAIL_PORT=25
MAIL_USERNAME=mvk_key_xxxxxxxxxx
MAIL_PASSWORD=mvk_sec_xxxxxxxxxx
MAIL_ENCRYPTION=tls
# application.properties
spring.mail.host=smtp-in.mailverick.com
spring.mail.port=25
spring.mail.username=mvk_key_xxxxxxxxxx
spring.mail.password=mvk_sec_xxxxxxxxxx
spring.mail.properties.mail.smtp.starttls.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.