--- title: Microsoft Outlook connector methods description: The 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. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/integrate-applications/microsoft-outlook-connector-methods.html release: australia topic_type: reference last_updated: "2026-03-12" reading_time_minutes: 11 breadcrumb: [Microsoft Outlook, Connectors, Automation components, RPA Desktop Design Studio, Robotic Process Automation \(RPA\) Hub, Workflow Data Fabric] --- # Microsoft Outlook connector methods The 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. The Microsoft Outlook connector enables the automation of routine tasks within the Microsoft Outlook application, integrating these functions into broader automated workflows. You 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. ## AddFolder Adds a new folder within a specified hierarchy and, optionally, a sub folder to the Outlook account set.
Parameter Description Data port type Data type
MainFolder Name of the folder that the method adds to the Outlook account.This parameter specifies the main folder where the new folder is added. Data in String
SubFolderName Name of the sub folder that the method adds under the main folder.This parameter specifies the name of the new folder to be created. If you use this parameter, you must use the IsSubFolder parameter. Data in String
IsSubFolder Option 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. Data in Boolean
## Close Closes the Microsoft Outlook explorer by specifying the profile name. This method can be used as a cleanup activity after all automation tasks are completed. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |ProfileName|This parameter specifies the Outlook profile name that you want to close.|Data in|String| ## DeleteFolder Deletes the specified folder and all subfolders under it. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |FolderName|Name of the folder that the method deletes.|Data in|String| ## DeleteMail Deletes one or more emails. Deletes an email based on its unique entry ID. **Tip:** Use the GetMails method to provide the emails the DeleteMail method will delete.
Parameter Description Data port type Data type
MailId Takes the email from which the method deletes the emails.This parameter specifies the unique entry ID of the email that needs to be deleted. Data in String
## ForwardMail Forwards an email based on its unique entry ID to a specified email address \(EmailID\).
Parameter Description Data port type Data type
MailId This parameter specifies the unique entry ID of the email that needs to be forwarded. Data in String
EmailID This parameter specifies the email address to which the email must be forwarded. Data in String
CC This parameter specifies Email address to send a carbon copy \(CC\) of the forwarded email. Data in String
BCC This parameter specifies Email address to send a blind carbon copy \(BCC\) of the forwarded email. Data in String
Subject This parameter specifies the subject line of the forwarded email. Data in String
Return This method returns a boolean value indicating whether the email was successfully forwarded. A return value of true signifies that the operation was successful. Data out Boolean
## GetAttachmentNames Retrieves a list of attachment names associated with an email specified by its unique entry ID. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |MailId|This parameter specifies the unique entry ID of the email for which attachment names are to be retrieved.|Data in|String| ## GetExistingAccounts Retrieves information about configured accounts such as a list of configured accounts and their count. This is helpful when there are multiple accounts configured in the outlook. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |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| |Count|This parameter is passed by reference. Upon calling this method, this parameter is populated with the count of configured accounts.|Data out|Int32| ## GetFolderNames Retrieves and returns a list of folder names from the active outlook account. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |Return|Returns the list of folder names from the active outlook account.|Data out|List1| ## GetMail Retrieves all details of an email, specified by its unique entry ID \(MailId\). To 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. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |MailId|This parameter specifies the unique entry ID of the email to retrieve details from.|Data in|String| ## GetMails Retrieves a list of mail entry IDs from a specified folder within an email system. The GetMails method retrieves a list of mail entry IDs from a specified folder within an email system.
Parameter Description Data port type Data type
FolderName This parameter specifies the name of the folder from which to retrieve mail entry IDs.Default value is "Inbox". Data in String
Filter This parameter specifies a filter condition to apply when retrieving mail entry IDs. Data in String
NoOfMails This parameter specifies the maximum number of mail entry IDs to retrieve. Default value is 10. Data in Int32
UnreadOnly This parameter indicates whether to retrieve only unread mails \(True\) or all mails \(False\). Default is True. Data in Boolean
AvoidMeetingItems This parameter specifies whether to exclude meeting items from the retrieved mail entry IDs. Default is True. Data in Boolean
FetchingOrder This parameter specifies the order in which mails are fetched. For example, FIFO, LIFO. Default is FIFO. Data in FetchingOrder
Return This parameter returns a list of emails from the specified folder. Data out List1
Count This parameter specifies total count of mail entry IDs retrieved. Data out Int32
## GetSenderName Retrieves the sender's email address associated with an email specified by its unique entry ID. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |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| |Return|This method returns a string value indicating sender name.|Data out|String| ## MarkAsRead Marks an email as read based on its unique entry ID.
Parameter Description Data port type Data type
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
Return This 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. Data out Boolean
## MarkAsUnread Marks an email as unread based on its unique entry ID.
Parameter Description Data port type Data type
MailId This parameter specifies the unique entry ID of the email that needs to be marked as unread. Data in String
Return This 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. Data out Boolean
## MoveMail Moves an email based on its unique entry ID from one folder to another folder within the email system. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |MailId|This parameter specifies the unique entry ID of the email that must be moved.|Data in|String| |DestinationFolder|This parameter specifies the name or path of the destination folder where the email must be moved.|Data in|String| ## ReadMsgFile Reads the contents of a .msg file from the file system. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |Filepath|This parameter specifies the path to the .msg file that must be read.|Data in|String| |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| ## Reply Generates and sends a reply to an email specified by its unique entry ID.
Parameter Description Data port type Data type
MailId This parameter specifies the unique entry ID of the email to which the reply is sent. Data in String
CC This parameter specifies Email address to send a carbon copy \(CC\) of the reply. Data in String
BCC This parameter specifies email address to send a blind carbon copy \(BCC\) of the reply. Data in String
Subject This parameter specifies the subject line of the reply email. Data in String
Body This parameter specifies the body content of the reply email. Data in String
Attachments This 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. When 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. Data in String
IsHtmlBody This parameter indicates whether the body content of the reply email is in HTML format. Default is False. Data in Boolean
Return This method returns a boolean value indicating whether the reply was successfully sent. A return value of true signifies that the operation was successful. Data out Boolean
## SaveAllAttachments Saves all attachments from an email specified by its unique entry ID into a specified folder path. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |MailId|This parameter specifies the unique entry ID of the email from which attachments must be saved.|Data in|String| |FolderPath|This parameter specifies the path of the folder where attachments must be saved.|Data in|String| ## SaveAttachment Saves specified attachment of a mail with given entry ID into a given file. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |MailId|This parameter specifies the unique entry ID of the email from which attachment must be saved.|Data in|String| |AttachmentName|This parameter specifies the name of the attachment that must be saved.|Data in|String| |Filepath|This parameter specifies the path of the file where attachment must be saved.|Data in|String| ## SaveMail Saves an email specified by its unique entry ID \(MailId\) to a file at a specified file path.
Parameter Description Data port type Data type
MailId This parameter specifies the unique entry ID of the email to be saved. Data in String
Filepath This parameter specifies the path where the email must be saved as a file Data in String
SaveType This parameter specifies the format in which the email must be saved. Default is MsgSaveType.olMSG, indicating Microsoft Outlook MSG format. Data in MsgSaveType
## SendMail Sends 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.
Parameter Description Data port type Data type
ToEmailId This parameter specifies email address of the recipient. Data in String
Image This parameter specifies an optional image to include in the email. Data in Drawing.Bitmap
From This parameter specifies the email address of the sender. If not specified, the default sender's address is used. Data in String
CC This parameter specifies Email address to send a carbon copy \(CC\) to. Data in String
BCC This parameter specifies email address to send a blind carbon copy \(BCC\) to. Data in String
Subject This parameter specifies the subject line of the email. Data in String
Body This parameter specifies the body content of the email. Data in String
Attachments This 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. When 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. Data in String
IsHtmlBody This parameter indicates whether the body of the email is in HTML format. Default is False. Data in Boolean
Return This method returns a boolean value indicating whether the email was successfully sent. A return value of true signifies that the operation was successful. Data out Boolean
## SentAs Sends an email on behalf of another email account.
Parameter Description Data port type Data type
ToEmailId This parameter specifies email address of the recipient. Data in String
SentOnBehalfEmailID This parameter specifies email address on whose behalf the email will be sent. Data in String
Subject This parameter specifies the subject line of the email. Data in String
Body This parameter specifies the body content of the email. Data in String
Attachments This 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. When 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. Data in String
IsHtmlBody This parameter indicates whether the body of the email is in HTML format. Default is False. Data in Boolean
## SetAccount Specifies the outlook account on which you want to perform operations for your automation tasks. The 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. |Parameter|Description|Data port type|Data type| |---------|-----------|--------------|---------| |AccountName|This parameter specifies the Outlook email account ID on which you want to perform operations.|Data in|String| **Parent Topic:**[Microsoft Outlook](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/microsoft-outlook-connector.md)