Receive Emails: Send & trust

Forward

Forward a message to someone else. The original attachments go with it, and the email is saved in the same conversation in Sent.

POSThttps://g.sendcorex.com/v1command: forward
i

The subject becomes Fwd: original and a Forwarded message block with the original email is added below your text. The forward does not pull the conversation back to Inbox.

i

Recipients who refused tracking on the preferences page are never tracked, even with true.

i

Emails sent from the mailbox carry no List-Unsubscribe header or unsubscribe link unless you send unsubscribe: true, because they are personal emails.

i

Everyone who receives an email from the mailbox becomes a contact in the account’s “Webmail” list and is trusted in this mailbox: their replies go to the Inbox and the address shows up in autocomplete. Senders the mailbox blocked stay blocked.

i

With unsubscribe: true, recipients who already unsubscribed from this mailbox are refused with RECIPIENT_UNSUBSCRIBED, and recipients lists them. Replies are never blocked.

Arguments

  • idstringrequired

    The message_uid of the message to forward.

  • tostringrequired

    Who receives the forward.

  • to_namestringoptional

    Recipient name.

  • ccstring[]optional

    Visible copies. to + cc + bcc up to 50 addresses.

  • bccstring[]optional

    Hidden copies.

  • htmlstringoptional

    Your text above the forwarded email. Send html or text.

  • textstringoptional

    Plain text version of your note.

  • include_attachmentsbooleanoptional

    Send the original attachments. Defaults to true.

  • quote_originalbooleanoptional

    Add the Forwarded message block. Defaults to true.

  • attachmentsobject[]optional

    Files to attach: [{ file_name, content, content_type }], content in base64. Up to 20 files and 25 MB in total. Every file is scanned; a dangerous one fails with FILE_BLOCKED.

  • compose_uidstringoptional

    Attachments you uploaded before with upload_attachment.

  • attachment_idsstring[]optional

    Which of the uploaded attachments to send. Without it, all of them.

  • track_opensbooleanoptional

    Track when each recipient opens the email (invisible pixel). Default true.

  • track_clicksbooleanoptional

    Track clicks on the links (each link goes through a redirect). Default true.

  • unsubscribebooleanoptional

    Add an unsubscribe link. Put [unsubscribe] in the body (as a link href or as plain text) where the link should go; without it, a default line is added at the end. Default false.

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "forward",
        args: {
          id: "Vj0xQUJDMTIz",
          to: "finance@acme.com",
          html: "<p>Can you check this invoice?</p>"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "forward",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "message_uid": "Vj0xQUJDMTIz",
        "thread_id": "thr_9a1c4e72",
        "message_id": "5e0b9c1a-3d7f-4a21-9a6e-2f1c8d4b7e90",
        "recipients": 1,
        "queued": true
      }
    }
  ]
}

Response fields

  • message_uid

    The id of the forward in Sent.

  • recipients

    How many copies were queued (1 credit each).

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401TOKEN_EXPIRED

    The access token has expired. Call Refresh Token and repeat the request.

  • 401INVALID_TOKEN

    The token is malformed, unknown or revoked.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + mailbox. Wait the number of seconds in Retry-After.

  • CMDRECIPIENT_UNSUBSCRIBED

    One or more recipients unsubscribed from this mailbox. `recipients` lists them: remove them or send again with `unsubscribe: false`.

  • CMDINVALID_ARGS

    A required argument is missing or invalid.

  • CMDNOT_FOUND

    The message, thread or folder does not exist for this token.

  • CMDINVALID_RECIPIENT

    The recipient is missing or not a valid email.

  • CMDATTACHMENTS_TOO_LARGE

    The attachments of the email add up to more than 25 MB, or the mailbox already has 500 MB of uploads waiting to be sent.

  • CMDFILE_BLOCKED

    A file was blocked by the security scan.

  • CMDNO_CREDITS

    The account has fewer email credits than recipients (1 credit per copy).

  • CMDSENDER_NOT_FOUND

    The sender behind the token is not registered.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.