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.

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.

SettingValue
Hostsmtp.mailverick.com
Port465 preferred, or 587
SecurityImplicit TLS on 465, STARTTLS on 587
UsernameYour mvk_key_ API key ID
PasswordYour 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_key_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_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.mailverick.com"
EMAIL_PORT = 465
EMAIL_HOST_USER = "mvk_key_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_key_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_key_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.