Save Draft / Template

Purpose

This API is used to send an email.

OAuth Scope

Use the scope

ZohoMail.messages.ALL (or) ZohoMail.messages.CREATE

to generate the Authtoken.

ALL - Grants full access to messages.

CREATE - Grants access to create messages.

Request URL

Method: POST

https://mail.zoho.com/api/accounts/{accountId}/messages

Path Parameters

  • accountId* long
    • This key is used to identify the account from which the email has to be sent. It is generated during account addition.
    • This parameter can be fetched from Get All User Accounts API.

Request Body (JSON object)

  • fromAddress* string
    • Provide the sender's email address (associated to the authenticated account).
    • Allowed values: Valid email address corresponding to the authenticated account for the From field.
  • toAddress* string
    • Provide the recipient's email address.
    • Allowed values: Valid recipient email address for the To field.
  • mode* string
    • Specifies whether the content should be saved as a draft or a template.
    • Allowed values:
      • draft
      • template
  • ccAddress string
    • Provide the recipient's email address for the Cc field.
    • Allowed values: Valid recipient email address for the Cc field.
  • bccAddress string
    • Provide the recipient's email address for the Bcc field.
    • Allowed values: Valid recipient email address for the Bcc field.
  • subject string
    • Provide the subject of the email.
  • content string
    • Provide the content of the email.
  • mailFormat string
    • Specify the format in which the mail needs to be sent. The value can be
      • html
      • plaintext
    • The default value is html.
  • askReceipt string
    • Specifies whether Read receipt from the recipient is requested or not.
    • Allowed values:
      • yes - Requesting a read receipt.
      • no - Not requesting a read receipt
  • encoding string
    • Specifies the encoding that is to be used in the email content. 
    • Allowed values: 
      • Big5
      • EUC-JP
      • EUC-KR
      • GB2312
      • ISO-2022-JP
      • ISO-8859-1
      • KOI8-R
      • Shift_JIS
      • US-ASCII
      • UTF-8
      • WINDOWS-1251
      • X-WINDOWS-ISO2022JP
    • The default value is UTF-8.

 

* - Mandatory parameter

Response Codes

Refer here for the response codes and their meaning.

Sample Request

Copiedcurl "https://mail.zoho.com/api/accounts/123456789/messages" \
-X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization:Zoho-oauthtoken *****" \
-d '{
        "mode": "draft",
        "subject": "Regd. Marketing Brochures",
        "fromAddress": "rebecca@zylker.com",
        "mailFormat": "html",
        "toAddress": "justinc@zylker.com",
        "content": "Hi Justin, please share the brochure content with the marketing team before proceeding with it. Thanks."
    }'