{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":21767,"path":"integrate-applications/microsoft-outlook-connector-methods.md","title":"Microsoft Outlook connector methods","bundle":null,"doc_type":null,"release":"australia","body":"\n# Microsoft Outlook connector methods\n\nThe Microsoft Outlook connector methods automate various actions on the Microsoft Outlook. In an automation flow, the methods are connected with other methods and components. To use the methods, you must first expose them.\n\nThe Microsoft Outlook connector enables the automation of routine tasks within the Microsoft Outlook application, integrating these functions into broader automated workflows.\n\nYou can automate processes such as sending or replying to emails without manual intervention. This connector provides various methods to facilitate the automation of actions within Microsoft Outlook. These methods can be seamlessly combined with other methods or components within an automation framework, enabling more complex and efficient workflow designs.\n\n## AddFolder\n\nAdds a new folder within a specified hierarchy and, optionally, a sub folder to the Outlook account set.\n\n<table id=\"table_k42_vfb_qtb\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMainFolder\n\n</td><td>\n\nName of the folder that the method adds to the Outlook account.This parameter specifies the main folder where the new folder is added.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSubFolderName\n\n</td><td>\n\nName of the sub folder that the method adds under the main folder.This parameter specifies the name of the new folder to be created.\n\nIf you use this parameter, you must use the IsSubFolder parameter.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nIsSubFolder\n\n</td><td>\n\nOption to indicate that the folder created in the SubFolderName parameter is a subfolder under the main folder.This parameter indicates whether the SubFolderName must be added as a subfolder within the main folder. Defaults to False, meaning SubFolderName is added directly under the main folder.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## Close\n\nCloses the Microsoft Outlook explorer by specifying the profile name.\n\nThis method can be used as a cleanup activity after all automation tasks are completed.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|ProfileName|This parameter specifies the Outlook profile name that you want to close.|Data in|String|\n\n## DeleteFolder\n\nDeletes the specified folder and all subfolders under it.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|FolderName|Name of the folder that the method deletes.|Data in|String|\n\n## DeleteMail\n\nDeletes one or more emails. Deletes an email based on its unique entry ID.\n\n**Tip:** Use the GetMails method to provide the emails the DeleteMail method will delete.\n\n<table id=\"table_nvy_c2j_qtb\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nTakes the email from which the method deletes the emails.This parameter specifies the unique entry ID of the email that needs to be deleted.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr></tbody>\n</table>## ForwardMail\n\nForwards an email based on its unique entry ID to a specified email address \\(EmailID\\).\n\n<table id=\"table_rvb_4q4_hcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nThis parameter specifies the unique entry ID of the email that needs to be forwarded.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nEmailID\n\n</td><td>\n\nThis parameter specifies the email address to which the email must be forwarded.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nCC\n\n</td><td>\n\nThis parameter specifies Email address to send a carbon copy \\(CC\\) of the forwarded email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBCC\n\n</td><td>\n\nThis parameter specifies Email address to send a blind carbon copy \\(BCC\\) of the forwarded email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSubject\n\n</td><td>\n\nThis parameter specifies the subject line of the forwarded email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis method returns a boolean value indicating whether the email was successfully forwarded. A return value of true signifies that the operation was successful.\n\n</td><td>\n\nData out\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## GetAttachmentNames\n\nRetrieves a list of attachment names associated with an email specified by its unique entry ID.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email for which attachment names are to be retrieved.|Data in|String|\n\n## GetExistingAccounts\n\nRetrieves information about configured accounts such as a list of configured accounts and their count.\n\nThis is helpful when there are multiple accounts configured in the outlook.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|Accounts|This parameter is passed by reference and is expected to be a List \\(Of String\\). Upon calling this method, it is populated with the list of configured account names.|Data out|List1|\n|Count|This parameter is passed by reference. Upon calling this method, this parameter is populated with the count of configured accounts.|Data out|Int32|\n\n## GetFolderNames\n\nRetrieves and returns a list of folder names from the active outlook account.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|Return|Returns the list of folder names from the active outlook account.|Data out|List1|\n\n## GetMail\n\nRetrieves all details of an email, specified by its unique entry ID \\(MailId\\).\n\nTo specify additional criteria for retrieving all details of an email, on the GetMail method bar, click the method settings icon \\(\\[Omitted image \"component-settings-icon.png\"\\] Alt text: Method settings icon.\\), select the required mail items such as CC, BCC, Subject, Body, Sender, To, AttachmentsCount, ReceivedTime, EntryId.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email to retrieve details from.|Data in|String|\n\n## GetMails\n\nRetrieves a list of mail entry IDs from a specified folder within an email system.\n\nThe GetMails method retrieves a list of mail entry IDs from a specified folder within an email system.\n\n<table id=\"table_nc2_zw4_hcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nFolderName\n\n</td><td>\n\nThis parameter specifies the name of the folder from which to retrieve mail entry IDs.Default value is \"Inbox\".\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nFilter\n\n</td><td>\n\nThis parameter specifies a filter condition to apply when retrieving mail entry IDs.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nNoOfMails\n\n</td><td>\n\nThis parameter specifies the maximum number of mail entry IDs to retrieve. Default value is 10.\n\n</td><td>\n\nData in\n\n</td><td>\n\nInt32\n\n</td></tr><tr><td>\n\nUnreadOnly\n\n</td><td>\n\nThis parameter indicates whether to retrieve only unread mails \\(True\\) or all mails \\(False\\). Default is True.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr><tr><td>\n\nAvoidMeetingItems\n\n</td><td>\n\nThis parameter specifies whether to exclude meeting items from the retrieved mail entry IDs. Default is True.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr><tr><td>\n\nFetchingOrder\n\n</td><td>\n\nThis parameter specifies the order in which mails are fetched. For example, FIFO, LIFO. Default is FIFO.\n\n</td><td>\n\nData in\n\n</td><td>\n\nFetchingOrder\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis parameter returns a list of emails from the specified folder.\n\n</td><td>\n\nData out\n\n</td><td>\n\nList1\n\n</td></tr><tr><td>\n\nCount\n\n</td><td>\n\nThis parameter specifies total count of mail entry IDs retrieved.\n\n</td><td>\n\nData out\n\n</td><td>\n\nInt32\n\n</td></tr></tbody>\n</table>## GetSenderName\n\nRetrieves the sender's email address associated with an email specified by its unique entry ID.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email for which the sender's email address is to be retrieved.|Data in|String|\n|Return|This method returns a string value indicating sender name.|Data out|String|\n\n## MarkAsRead\n\nMarks an email as read based on its unique entry ID.\n\n<table id=\"table_dmc_rrc_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nThis parameter specifies the unique entry ID of the email for which the sender's email address is to be retrieved.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis method returns a boolean value indicating whether the email was successfully marked as read.A return value of true signifies that the operation was successful.\n\n</td><td>\n\nData out\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## MarkAsUnread\n\nMarks an email as unread based on its unique entry ID.\n\n<table id=\"table_cpr_csc_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nThis parameter specifies the unique entry ID of the email that needs to be marked as unread.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis method returns a boolean value indicating whether the email was successfully marked as unread. A return value of true signifies that the operation was successful.\n\n</td><td>\n\nData out\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## MoveMail\n\nMoves an email based on its unique entry ID from one folder to another folder within the email system.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email that must be moved.|Data in|String|\n|DestinationFolder|This parameter specifies the name or path of the destination folder where the email must be moved.|Data in|String|\n\n## ReadMsgFile\n\nReads the contents of a .msg file from the file system.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|Filepath|This parameter specifies the path to the .msg file that must be read.|Data in|String|\n|Body|This parameter is passed by reference \\(ByRef\\) and is populated with the body content of the .msg file after the method call.|Data out|String|\n\n## Reply\n\nGenerates and sends a reply to an email specified by its unique entry ID.\n\n<table id=\"table_e1f_q5c_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nThis parameter specifies the unique entry ID of the email to which the reply is sent.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nCC\n\n</td><td>\n\nThis parameter specifies Email address to send a carbon copy \\(CC\\) of the reply.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBCC\n\n</td><td>\n\nThis parameter specifies email address to send a blind carbon copy \\(BCC\\) of the reply.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSubject\n\n</td><td>\n\nThis parameter specifies the subject line of the reply email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBody\n\n</td><td>\n\nThis parameter specifies the body content of the reply email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nAttachments\n\n</td><td>\n\nThis parameter specifies file paths of the attachments to include in the reply email. Multiple files can be separated by the pipe symbol or the vertical bar \\(\\|\\) to split the attachment file paths.\n\nWhen you upgrade automations to plugins above 13.0, update earlier automations that use \",\" or \";\" with \"\\|\", when multiple file paths are passed. Use the pipe symbol or the vertical bar \\(\\|\\) to split the attachment file paths.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nIsHtmlBody\n\n</td><td>\n\nThis parameter indicates whether the body content of the reply email is in HTML format. Default is False.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis method returns a boolean value indicating whether the reply was successfully sent. A return value of true signifies that the operation was successful.\n\n</td><td>\n\nData out\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## SaveAllAttachments\n\nSaves all attachments from an email specified by its unique entry ID into a specified folder path.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email from which attachments must be saved.|Data in|String|\n|FolderPath|This parameter specifies the path of the folder where attachments must be saved.|Data in|String|\n\n## SaveAttachment\n\nSaves specified attachment of a mail with given entry ID into a given file.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|MailId|This parameter specifies the unique entry ID of the email from which attachment must be saved.|Data in|String|\n|AttachmentName|This parameter specifies the name of the attachment that must be saved.|Data in|String|\n|Filepath|This parameter specifies the path of the file where attachment must be saved.|Data in|String|\n\n## SaveMail\n\nSaves an email specified by its unique entry ID \\(MailId\\) to a file at a specified file path.\n\n<table id=\"table_hfc_xvc_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nMailId\n\n</td><td>\n\nThis parameter specifies the unique entry ID of the email to be saved.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nFilepath\n\n</td><td>\n\nThis parameter specifies the path where the email must be saved as a file\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSaveType\n\n</td><td>\n\nThis parameter specifies the format in which the email must be saved. Default is MsgSaveType.olMSG, indicating Microsoft Outlook MSG format.\n\n</td><td>\n\nData in\n\n</td><td>\n\nMsgSaveType\n\n</td></tr></tbody>\n</table>## SendMail\n\nSends an email to recipient. It offers various optional parameters to customize the email, including the ability to add images, set the sender's address, and specify CC and BCC recipients.\n\n<table id=\"table_l34_2xc_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nToEmailId\n\n</td><td>\n\nThis parameter specifies email address of the recipient.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nImage\n\n</td><td>\n\nThis parameter specifies an optional image to include in the email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nDrawing.Bitmap\n\n</td></tr><tr><td>\n\nFrom\n\n</td><td>\n\nThis parameter specifies the email address of the sender. If not specified, the default sender's address is used.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nCC\n\n</td><td>\n\nThis parameter specifies Email address to send a carbon copy \\(CC\\) to.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBCC\n\n</td><td>\n\nThis parameter specifies email address to send a blind carbon copy \\(BCC\\) to.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSubject\n\n</td><td>\n\nThis parameter specifies the subject line of the email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBody\n\n</td><td>\n\nThis parameter specifies the body content of the email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nAttachments\n\n</td><td>\n\nThis parameter specifies file paths of the attachments to include in the email.Multiple files can be separated by the pipe symbol \\(\\|\\) to split the attachment file paths.\n\nWhen you upgrade automations to plugins above 13.0, update earlier automations that use \",\" or \";\" with \"\\|\", when multiple file paths are passed. Use the pipe symbol or the vertical bar \\(\\|\\) to split the attachment file paths.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nIsHtmlBody\n\n</td><td>\n\nThis parameter indicates whether the body of the email is in HTML format. Default is False.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr><tr><td>\n\nReturn\n\n</td><td>\n\nThis method returns a boolean value indicating whether the email was successfully sent. A return value of true signifies that the operation was successful.\n\n</td><td>\n\nData out\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## SentAs\n\nSends an email on behalf of another email account.\n\n<table id=\"table_zsn_3yc_pcc\"><thead><tr><th>\n\nParameter\n\n</th><th>\n\nDescription\n\n</th><th>\n\nData port type\n\n</th><th>\n\nData type\n\n</th></tr></thead><tbody><tr><td>\n\nToEmailId\n\n</td><td>\n\nThis parameter specifies email address of the recipient.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSentOnBehalfEmailID\n\n</td><td>\n\nThis parameter specifies email address on whose behalf the email will be sent.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nSubject\n\n</td><td>\n\nThis parameter specifies the subject line of the email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nBody\n\n</td><td>\n\nThis parameter specifies the body content of the email.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nAttachments\n\n</td><td>\n\nThis parameter specifies file paths of the attachments to include in the email.Multiple files can be separated by the pipe symbol \\(\\|\\) to split the attachment file paths.\n\nWhen you upgrade automations to plugins above 13.0, update earlier automations that use \",\" or \";\" with \"\\|\", when multiple file paths are passed. Use the pipe symbol or the vertical bar \\(\\|\\) to split the attachment file paths.\n\n</td><td>\n\nData in\n\n</td><td>\n\nString\n\n</td></tr><tr><td>\n\nIsHtmlBody\n\n</td><td>\n\nThis parameter indicates whether the body of the email is in HTML format. Default is False.\n\n</td><td>\n\nData in\n\n</td><td>\n\nBoolean\n\n</td></tr></tbody>\n</table>## SetAccount\n\nSpecifies the outlook account on which you want to perform operations for your automation tasks.\n\nThe SetAccount method must be used initially, before any other method of this connector, to specify or set the context or email account for subsequent methods to execute upon.\n\n|Parameter|Description|Data port type|Data type|\n|---------|-----------|--------------|---------|\n|AccountName|This parameter specifies the Outlook email account ID on which you want to perform operations.|Data in|String|\n\n**Parent Topic:**[Microsoft Outlook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/microsoft-outlook-connector.md)\n\n"}}