Get email list
Command Description
Retrieve Office365 Outlook emails and return them in array format
Command Prototype
arrayRet = Office365.GetMail(o365Ctx ,strAccount , strFolderName , bUnreadOnly ,orderByDate ,strQuery ,bMarkRead ,strMailId ,iTop)
Command parameter
parameter | required | type | Default value | describe |
---|---|---|---|---|
o365Ctx | True | expression | o365Ctx | Objects returned by connecting to the Office365 server |
strAccount | True | string | "" | Account to be operated |
strFolderName | True | string | "" | The email folder that needs to be obtained can be a path, such as "inbox/subdirectories" |
bUnreadOnly | True | boolean | True | Do you only retrieve unread emails |
orderByDate | True | enum | "NewestFirst" | The rule of sorting by time |
strQuery | True | string | "" | Custom query statement, see for usagehttps://learn.microsoft.com/zh-cn/graph/filter-query-parameter?tabs=http |
bMarkRead | True | boolean | True | Mark as read email |
strMailId | True | string | "" | Specify email ID, default empty |
iTop | True | number | 0 | Specify the number of messages to be obtained. 0 means All |
Return result
ArrayRet, Assign the result of running the command to this variable.
Run instance
/*********************************获取邮件列表**************************************
命令原型:
arrayRet = Office365.GetMail(o365Ctx ,strAccount , strFolderName , bUnreadOnly ,orderByDate ,strQuery ,bMarkRead ,strMailId ,iTop)
入参:
o365Ctx--Office365对象.注:连接Office365服务器返回的对象
strAccount--帐户.注:待操作的帐户
strFolderName--邮箱文件夹.注:需要获取的邮箱文件夹,可以为路径,如"收件箱/子目录"
bUnreadOnly--未读邮件.注:是否只获取未读邮件
orderByDate--时间排序规则.注:按时间排序的规则
strQuery--查询语句.注:自定义查询语句,用法见 https://learn.microsoft.com/zh-cn/graph/filter-query-parameter?tabs=http
bMarkRead--标记已读.注:是否标记为已读邮件
strMailId--邮件Id.注:指定邮件Id,默认空
iTop--邮件数量.注:指定获取邮件的数量,0为全部获取
出参:
arrayRet--函数调用的输出保存到的变量.
注意事项:
无
********************************************************************************/
Dim arrayRet = ""
arrayRet = Office365.GetMail(o365Ctx ,"" , "" , True ,"NewestFirst" ,"" ,True ,"" ,0)
TracePrint(arrayRet)