Choose where you’d like to start

Get Message from Zoho Mail

Note: This task is applicable to all Zoho services, except Zoho Creator.

Overview

The zoho.mail.getMessage task is used to retrieve details of an email from Zoho Mail.

Syntax

<response> = zoho.mail.getMessage(<message_id>, <connection>);

where:

ParamsData typeDescription

<response> 

KEY-VALUE

The response that represents the folder name, sender, from address, cc, bcc, subject and content of the email.

<message_id>

NUMBER

The ID of the email whose details will be retrieved.

Note: You can get the message_id from the Zoho Mail URL. The URL is in the following format:
https://mail.zoho.com/zm/#mail/folder/<folder_id>/p/<message_id>

<connection> 

TEXT

The link name of the connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • The scope required for this task as mentioned by Zoho Mail API is messages.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example

The following script retrieves details of the specified email in Zoho Mail:

response = zoho.mail.getMessage(6729326000000548039, "mail_oauth_connection");

where,

response
The KEY-VALUE response that represents the folder name, sender, from address, cc, bcc, subject and content of the email.
6729326000000548039
The NUMBER that represents the ID of the email whose details will be retrieved.
"mail_oauth_connection"
The TEXT that represents the link name of Zoho Mail OAuth connection.

Response Format

Success Response

  • The success response will be returned in the following format:

       {
       "CC":"",
       "BCC":"",
       "RDT":"Fri, 07 Jul 2017 11:52:31 +0530",
       "SENTTIMEINMILLIS":"1499432506000",
       "FOLDERNAME":"India-all",
       "SENDER":"organic@zylker.com",
       "NT":0,
       "INREPLYTO":"<15d1b9be3c3.d18d561f9228.8036482621812440414@zylker.com>",
       "STATUS2ID":0,
       "MAILID":"<15d1ba3cd78.124070c079319.3563819432306205449@zylker.com>",
       "PRIORITY":3,
       "FROM":"organic@zylker.com",
       "SHRINKED":false,
       "ISAUTH":true,
       "MA":0,
       "SENTTIME":"Fri, 07 Jul 2017 11:31:46 +0530",
       "REFHEADER":"<15d1b9be3c3.d18d561f9228.8027309768891440414@zylker.com>",
       "SUBJECT":"Organic store will open only at 4 pm today.",
       "TO":"&quot;team@zylker.com&quot;&lt;team@zylker.com&gt;",
       "CONTENT":"<meta /><div><div style=\"font-size: 10.0pt;font-family: Verdana , Arial , Helvetica , sans-serif;\"><div><br /><\/div><div><br /><\/div><div class=\"zmail_extra\"><div><div><br /><\/div><\/div><div><br /><\/div><blockquote style=\"border-left: 1.0px solid rgb(204,204,204);padding-left: 6.0px;margin: 0 0 0 5.0px;\"><div><div style=\"font-size: 10.0pt;font-family: Verdana , Arial , Helvetica , sans-serif;\"><div><br /><\/div><div>Hi All, <br /><\/div><div>This is to inform you that organic store will open only at 4 pm today. Please plan your purchases accordingly.<br /><\/div><div><br /><\/div><div><br /><\/div><div>With Kindly Regards<br /><\/div><div><br /><\/div><div>Organic Team<br /><\/div><\/div><\/div><\/blockquote><\/div><div><br /><\/div><\/div><\/div>",
       "UUID":"358c12e5-77a7-4120-b6f7-2a007b09ddd7",
       "RETURNPATH":"<organic@zylker.com>"
    }

Success Response for a mail containing attachments

   {
   "RR":-1,
   "MSGINTEG":"{\"8\":[{\"SES\":0,\"SSS\":0,\"HSM\":false,\"MEL\":1}]}",
   "HASINLINE":false,
   "ATSIZE":"[422107,93658]",
   "NT":0,
   "MAILID":"<1727e29835f.be5e20a36825.3764880084713656439@zylker.com>",
   "PRIORITY":3,
   "FROM":"dinesh@zylker.com",
   "M":"1591254565082116773",
   "SPAMDATA":"{\"ISAUTH\":true,\"ALERT_EMAILLIST\":[],\"AAM\":[],\"TRUSTED_DOMAIN\":\"zylker.com\",\"IS_PHISHING_MARKED\":false}",
   "NEWATT":"[{\"st\":0,\"attType\":1,\"e\":\"1591254565084432773\",\"part\":\"138105488653440090\",\"fn\":\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020.png\",\"l\":[],\"fmt\":\"png\",\"fs\":\"422107\",\"ft\":101,\"et\":1,\"p\":\"138105473493440090\",\"inline\":false,\"size\":\"422107\",\"u\":\"52987684-a632-11ea-9246-0cc47ab0ac94\",\"appId\":\"0\",\"name\":\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020.png\",\"tn\":false,\"Id\":\"138105473493440090\",\"id\":\"138105473493440090\",\"shT\":0},{\"st\":0,\"attType\":1,\"e\":\"1591254565082116773\",\"part\":\"138105473494420000\",\"fn\":\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020 (1).png\",\"l\":[],\"fmt\":\"png\",\"fs\":\"93658\",\"ft\":101,\"et\":1,\"p\":\"138105473494420000\",\"inline\":false,\"size\":\"93658\",\"u\":\"5298768e-a632-11ea-9246-0cc47ab0ac94\",\"appId\":\"0\",\"name\":\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020 (1).png\",\"tn\":false,\"Id\":\"138105473494420000\",\"id\":\"138105473494420000\",\"shT\":0}]",
   "ISAUTH":true,
   "ATNAME":"[\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020.png\",\"Image in 24 slide of Introduction to Deluge - Zoho Inspire 2020 (1).png\"]",
   "R":"1591254564584",
   "PHONE_NUMBERS":"[\"9999-999-999\",\"044-6699-7070\"]",
   "DELIVEREDTO":"dinesh@zylker.com",
   "MA":0,
   "SENTTIME":"Thu, 04 Jun 2020 12:39:18 +0530",
   "CONTENT":"<meta /><div><div style=\"font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10.0pt;\"><div><br /><\/div><div id=\"\"><div><div><span class=\"x_-1507915643font\" style=\"font-family: Calibri, Verdana, Arial, sans-serif;\"><span class=\"x_-1507915643size\" style=\"font-size: 16.0px;\"><span>Best,<\/span><\/span><\/span><br /><\/div><div><span class=\"x_-1507915643font\" style=\"font-family: georgia, \"times new roman\", times, serif;\"><span class=\"x_-1507915643size\" style=\"font-size: 16.0px;\"><span>Dino<\/span><\/span><\/span><br /><\/div><div><span class=\"x_-1507915643size\" style=\"font-size: 16.0px;\">(Zoho Deluge<\/span>&nbsp;<span class=\"x_-1507915643size\" style=\"font-size: 18.0px;\"><b><span><u><span class=\"x_-1507915643colour\" style=\"color: rgb(102,102,102);\"><span class=\"x_-1507915643font\" style=\"font-family: \"courier new\", courier, monospace, sans-serif;\">Te<\/span><\/span><\/u><\/span><u><span class=\"x_-1507915643colour\" style=\"color: rgb(102,102,102);\"><span class=\"x_-1507915643font\" style=\"font-family: \"courier new\", courier, monospace, sans-serif;\">chnical&nbsp;Writ<\/span><\/span><\/u><span><span class=\"x_-1507915643colour\" style=\"color: rgb(102,102,102);\"><span class=\"x_-1507915643font\" style=\"font-family: \"courier new\", courier, monospace, sans-serif;\"><u>er<\/u>)<\/span><\/span><\/span><\/b><\/span><br /><\/div><div><span class=\"x_-1507915643size\" style=\"font-size: 16.0px;\"><span class=\"x_-1507915643font\" style=\"font-family: \"comic sans ms\";\"><u>Home<\/u>&nbsp;<\/span><span class=\"x_-1507915643font\" style=\"font-family: Verdana, Arial, Helvetica, sans-serif;\">: 6374<\/span><span class=\"x_-1507915643font\" style=\"font-family: \"comic sans ms\";\">-900-258<\/span><\/span><br /><\/div><div><span class=\"x_-1507915643size\" style=\"font-size: 16.0px;\"><span class=\"x_-1507915643font\" style=\"font-family: \"comic sans ms\";\"><u>Office<\/u>&nbsp;<\/span><span class=\"x_-1507915643font\" style=\"font-family: georgia, \"times new roman\", times, serif;\">: <\/span><span class=\"x_-1507915643font\" style=\"font-family: \"comic sans ms\";\">044-6699-7070<\/span><span><span class=\"x_-1507915643font\" style=\"font-family: Verdana, Arial, Helvetica, sans-serif;\">&nbsp;<\/span><span class=\"x_-1507915643font\" style=\"font-family: Calibri, Verdana, Arial, sans-serif;\"><u><i>ext<\/i><\/u>&nbsp;<\/span><\/span><span class=\"x_-1507915643font\" style=\"font-family: \"comic sans ms\";\">1603<\/span><\/span><br /><\/div><div><br /><\/div><\/div><div><br /><\/div><\/div><br /><br /><\/div><br /><\/div>",
   "SENDMAILTYPE":2,
   "UUID":"007db78d-3fc1-4155-41b6-0b1c1e4a882b",
   "CID":"1591254605355410001",
   "CC":"",
   "BCC":"",
   "RDT":"Thu, 04 Jun 2020 12:39:24 PM +0530",
   "SENTTIMEINMILLIS":"1591279758000",
   "FOLDERNAME":"Personal",
   "SENDER":"dinesh",
   "INREPLYTO":"",
   "STATUS2ID":0,
   "ATPATH":"[\"1591254565082116773_attach_138105473493440090\",\"1591254565082116773_attach_138105473494420000\"]",
   "CALTYPE":0,
   "ATSTORE":"[\"1591254565082116773\",\"1591254565082116773\"]",
   "TID":"0",
   "SHOWDISPLAYNAME":true,
   "SHRINKED":false,
   "SUBJECT":"test",
   "TO":"\"Dinesh Dadi\"<dinesh@zylker.com>",
   "SMT":2,
   "RETURNPATH":"<dinesh@zylker.com>"
}

Failure Response

  • The failure response for incorrect message ID will be returned in the following format:

    {  
       "message":"No data available",
       "status":"failure"
    }

Related Links

Get Started Now

Execute