POST - To Send an Email
Purpose
The API is used to Send an Email.
Request URL
https://mail.zoho.com/api/accounts/<accountId>/messages
Note: You can use the API here to retrieve the accountid for the currently authenitcated user.
Request Parameters
Parameter | Data Type | Description |
accountId* | Long | accountID - The unique Zoho Account number associated with the particular account. |
* - Mandatory parameters
Request Body (JSON Object)
Parameter | Data Type | Allowed Values | Description |
fromAddress* | String | Valid from email address corresponding to the account | Sender's email address for the From field (associated to the authenticated account) |
toAddress* | String | Valid recipient email address for the To field | Recipient email address for the To field |
ccAddress | String | Valid recipient email address for the Cc field | Recipient email address for the Cc field |
bccAddress | String | Valid recipient email address for the Bcc field | Recipient email address for the Bcc field |
subject | String | - | Subject of the email that should be sent |
encoding | String | Default value is UTF-8. Other allowed encoding values are listed below
| The encoding that is to be used in the email content. |
mailFormat | String |
| Whether the email should be sent in HTML format or in plain text. The default value is html |
askReceipt | String | "Yes" | Whether you need to request Read receipt from the recipient. If required, enter the value as "yes". |
* - Mandatory parameters
Schedule emails
With this API you can also schedule when to send your email. To schedule an email, follow the same procedure as above along with the upcoming additional parameters.
Parameter | Data Type | Allowed Values | Description |
isSchedule* | Boolean | True | Add this parameter to schedule when to send your email. |
scheduleType* | Int | ||
1/2/3/4/5/6 | "1" - Schedules email to be sent after one hour from the time of the request. | ||
"2" - Schedules email to be sent after two hours from the time of the request. | |||
"3" - Schedules email to be sent after four hours from the time of the request. | |||
"4" - Schedules email to be sent by the morning of the next day from the time of the request. | |||
"5" - Schedules email to be sent by the afternoon of the next day from the time of the request. | |||
"6" - Choose custom date and time of your choice. | |||
timeZone | String | ( GMT 5:30 ) India Standard Time(Asia/Calcutta) | Enter the timezone you want to use for scheduling your email. This field is mandatory if you chose value 6 in the scheduleType parameter. |
scheduleTime | dateTime | MM/DD/YYYY HH:MM | Enter the date and time you want to schedule your email. This field is mandatory if you chose value 6 in the scheduleType parameter. |
* - Mandatory parameters
Response Codes
Please refer Response Codes.
Sample Request (Request Body)
Copied{
"fromAddress": "my@mydomain.com",
"toAddress": "family@mydomain.com",
"ccAddress": "colleagues@mywork.com",
"bccAddress": "restadmin1@restapi.com",
"subject": "Email - Always and Forever",
"content": "Email can never be dead. The most neutral and effective way, that can be used for one to many and two way communication.",
"askReceipt" : "yes"
}