Get email list
Command Description
Retrieve emails from the Exchange mailbox and return them in array format
Command Prototype
arrayRet = Exchange.GetMailMessages(strDomain ,strUserName ,strPassword ,strServer ,strEmailAutoDiscover ,strSharedMailBox ,strFolderName ,bUnreadOnly ,bMarkRead ,bAsHtml ,iTop)
Command parameter
parameter | required | type | Default value | describe |
---|---|---|---|---|
strDomain | True | string | "" | AD domain to connect to |
strUserName | True | string | "" | Exchange account used for sending emails |
strPassword | True | string | "" | Exchange account password for sending emails |
strServer | True | string | "" | Exchange server address |
strEmailAutoDiscover | True | string | "" | Use this email address to automatically search for servers, which is effective when the server enables automatic discovery |
strSharedMailBox | True | string | "" | Shared email account linked to Exchange account |
strFolderName | True | string | "inbox" | The email folders that need to be obtained, such as "Inbox", "Drafts", "Sent Items" and other folders |
bUnreadOnly | True | boolean | True | Do you only retrieve unread emails |
bMarkRead | True | boolean | True | Do you want to mark the unread emails obtained as read |
bAsHtml | True | boolean | False | Is it in HTML format |
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 = Exchange.GetMailMessages(strDomain ,strUserName ,strPassword ,strServer ,strEmailAutoDiscover ,strSharedMailBox ,strFolderName ,bUnreadOnly ,bMarkRead ,bAsHtml ,iTop)
入参:
strDomain--域.注:要连接的AD域
strUserName--用户名.注:用于发送邮件的Exchange帐户
strPassword--密码.注:用于发送邮件的Exchange帐户密码
strServer--服务器地址.注:Exchange服务器地址
strEmailAutoDiscover--自动发现地址.注:使用该邮箱地址自动搜索服务器,服务器开启自动发现时有效
strSharedMailBox--共享邮箱地址.注:链接至Exchange帐户的共享邮箱帐户
strFolderName--邮箱文件夹.注:需要获取的邮箱文件夹,如"收件箱","草稿","已发送邮件"等文件夹
bUnreadOnly--未读邮件.注:是否只获取未读邮件
bMarkRead--标记为已读.注:是否将获取的未读邮件标记为已读
bAsHtml--html格式.注:是否html格式
iTop--邮件数量.注:指定获取邮件的数量,0为全部获取
出参:
arrayRet--函数调用的输出保存到的变量.
注意事项:
无
********************************************************************************/
Dim arrayRet = ""
arrayRet = Exchange.GetMailMessages("" ,"" ,"" ,"" ,"" ,"" ,"inbox" ,True ,True ,False ,0)
TracePrint(arrayRet)