Email

Send Email

Send a transactional or marketing email to one or multiple recipients. Supports HTML bodies, attachments, reply-to, and marketing headers.

POSThttps://mail.sendcorex.com/v3.0/send
i

Need to send to multiple recipients at once? Pass to as an array — see Send Batch Emails.

Body parameters

  • tostring | string[]required

    Recipient email address or array of up to 50 addresses.

    e.g. "user@example.com" or ["a@x.com", "b@x.com"]

  • fromstringrequired

    Sender email address. Must belong to a verified domain in your account.

  • senderNamestringrequired

    Display name shown in the recipient's inbox.

  • subjectstringrequired

    Email subject line. HTML is not supported here.

  • bodystringrequired

    HTML content of the email body.

  • replyTostringoptional

    Reply-to address. Defaults to the sender address if omitted.

  • transactionalbooleanoptional

    Set true to mark as transactional. Defaults to false.

  • attachmentsobject[]optional

    Array of attachment objects. See Send Attachments for full details.

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://mail.sendcorex.com/v3.0/send',
  {
    to: 'user@example.com',
    from: 'noreply@yourdomain.com',
    senderName: 'My App',
    subject: 'Welcome aboard!',
    body: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
    replyTo: 'support@yourdomain.com',
  },
  {
    headers: { Authorization: process.env.SENDCOREX_API_KEY },
  }
);

const { id, ids, recipients } = response.data;

Response

{
  "success": true,
  "message": "Email queued successfully",
  "code": "EMAIL_QUEUED_SUCCESS",
  "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f",
  "ids": [
    { "id": "3f2a1b4c-8e9d-4f7a-b2c3-1a2b3c4d5e6f", "recipient": "user@example.com" }
  ],
  "recipients": 1,
  "scheduledAt": null
}

My messages are flagged as spam

Every message goes through our anti-spam filter. When one is flagged, the request returns 403 with the code SPAM_DETECTED and the email is held in quarantine.

403

Flagged as spam

{
  "error": "Email content flagged as spam.",
  "code": "SPAM_DETECTED",
  "detectionId": "9c1e5a7d-2b4f-4e8a-a6d3-0f1b2c3d4e5f",
  "quarantine_id": "qtn_3f2a1b4c8e9d4f7a",
  "release_instructions": "POST /v3.0/quarantine/release with { quarantine_id }",
  "expires_in": "3 hours"
}
  • code

    Always SPAM_DETECTED for this response.

  • detectionId

    Identifier of this detection. Include it when contacting support.

  • quarantine_id

    Pass this to /quarantine/release to send the email after review.

  • release_instructions

    How to release the email.

  • expires_in

    How long the quarantine record is kept before it expires.

!

A quarantined email is not delivered. Use /quarantine/release to send it after review. The quarantine record expires after 3 hours.

If quarantine_id, release_instructions and expires_in come back as null, the email was blocked without a quarantine record. It cannot be released: fix the content and send it again.

Errors return a JSON object with error, code and responseTime.

  • 401MISSING_AUTH_HEADER

    No Authorization header present.

  • 401INVALID_API_KEY

    The API key is invalid or revoked.

  • 401ACCOUNT_BLOCKED

    Account has been blocked.

  • 401NO_CREDITS_LEFT

    No email credits remaining.

  • 401DOMAIN_NOT_VALIDATED

    Sender domain not verified.

  • 401LISTED_SPAM_HAUS

    Sender domain is listed on Spamhaus.

  • 401ISP_DOMAIN_BLOCKED

    Sending from well-known domains (gmail.com, outlook.com, etc) is not allowed.

  • 401FROM_HEADER_DOMAIN_MISMATCH

    From header domain not authorized for this sender.

  • 401USER_NOT_FOUND

    User not found.

  • 401MISSING_USER_PRIVILEGES

    Missing user privileges.

  • 401EMAIL_CREDITS_NOT_FOUND

    Error fetching email credits.

  • 429CREDENTIAL_TEMPORARILY_BLOCKED

    API key temporarily blocked due to repeated policy violations.

  • 429IP_TEMPORARILY_BLOCKED

    Requesting IP temporarily blocked due to repeated policy violations.

  • 400MISSING_FROM

    The from field is missing or empty.

  • 400INVALID_FROM_FORMAT

    The from field must be a valid email address.

  • 400MISSING_SENDERNAME

    The senderName field is missing or empty.

  • 400INVALID_SENDERNAME_FORMAT

    The senderName field contains invalid characters.

  • 400MISSING_SUBJECT

    The subject field is missing or empty.

  • 400MISSING_BODY

    The body field is missing or empty.

  • 400MISSING_TOADDRESS

    The to field is missing or empty.

  • 400MISSING_TO

    The to field is missing or empty.

  • 400INVALID_TOADDRESS

    One or more recipient addresses are malformed.

  • 400TOADDRESS_LIMIT_EXCEEDED

    More than 50 recipients in the to array.

  • 400INVALID_SCHEDULED_AT

    scheduled_at is not a valid date or is in the past.

  • 400INVALID_SENDER_FORMAT

    The sender email format is invalid.

  • 400HEADER_NOT_ALLOWED

    Custom header key is not on the allowed list (List-Unsubscribe, List-Id, X-*, etc).

  • 400INVALID_HEADER_VALUE

    Header value contains invalid characters (CR/LF not allowed).

  • 400DANGEROUS_ATTACHMENT

    One or more attachments were blocked for security reasons.

  • 403ACCOUNT_RESTRICTED

    Account is temporarily restricted.

  • 403DAILY_LIMIT

    Daily email sending limit reached.

  • 403SPAM_DETECTED

    Email content flagged as spam. Response includes quarantine_id and release instructions.

  • 403SENDER_NAME_MISMATCH

    Multiple sender names detected for same address.

  • 403FOLLOWUP_PATTERN_DETECTED

    Email content flagged as repeated suspicious follow-up pattern.

  • 403SCAM_PATTERN_DETECTED

    Email content flagged as scam pattern.

  • 403ACCOUNT_SUSPENDED_SPOOFING

    Account suspended due to repeated From header spoofing attempts.

  • 500INTERNAL_SERVER_ERROR

    Unexpected server error. Try again.

  • 500PARSE_ERROR

    Failed to process email content (MIME parse failure).

  • 500PERSIST_FAILED

    Failed to queue email (database persistence failure).