Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Email connector methods

The methods in the Email connector retrieve, send, and reply to email messages, and can download attachments. Use the SetConfig method first to set up the connection to your mail server.

Use the SetConfig method to configure the mail server properties and access credentials. This method must precede all the other Email connector methods in the automation.

The GetMails method retrieves messages from the mail server and passes them to other methods as an object that contains one or more messages. The ReadMail, ReplyMail, and SaveAllAttachments methods operate on a single message at a time. When these methods receive an object that contains more than one message, the automation must use a For Each or For Loop method to iterate each message in the collection.

SetConfig

Sets up the connection to the mail server so that the automation can work with messages.

Note: You must run this method before running any other methods in the Email connector.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?Notes
UsernameUser name to log in to the mail serverData InString(none)Yes 
PasswordPassword to log in to the mail serverData InString(none)Yes 
UseDefaultCredentialsSends the default credentials of the currently logged-in user to the SMTP server.Data InBooleanFalseNo 
SmtpMailServerName of the SMTP serverData InStringsmtp.gmail.comNoAccess to Gmail by using the Email connector is not currently supported. Make sure to change the default value.
ImapMailServerName of the IMAP serverData InStringimap.gmail.comNoAccess to Gmail by using the Email connector is not currently supported. Make sure to change the default value.
SSLUse the Secure Socket Layer protocolData InBooleanTrueNo 
SmtpPortSMTP port numberData InInteger587No 
ImapPortIMAP port numberData InInteger993No 

GetMails

Returns messages from the mail server for use by other methods. You can set the method to retrieve either read (seen) or unread (unseen) messages and specify the folder that they're gathered.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?Notes
FolderNameName of the IMAP folder that the method fetches the collection (for example, Inbox)Data inStringInboxYesTo specify a nested IMAP folder, enter the folder hierarchy by using backslashes (for example, Project\Meetings)
FilterSet to get only unread (Unseen) or read (Seen) messagesData inFilterModeUnseenYes 
ReturnReturns the mail collection as an objectData outObjectObjectYes 

MarkAsRead

Marks messages from a specified folder as read.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionPort typeData typeDefault valueRequired?Notes
MailObjectThe email object based on which the corresponding message is marked as readData inObjectObjectYes 
FolderNameName of the IMAP folder that the email object is fetchedData inStringInboxYesTo specify a nested IMAP folder, enter the folder hierarchy by using backslashes (for example, Project\Meetings)

MarkAsUnread

Marks messages from a specified folder as unread.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionPort typeData typeDefault valueRequired?Notes
MailObjectThe email object based on the corresponding email that is marked as unread.Data inObjectObjectYes 
FolderNameName of the IMAP folder that the email object is fetched.Data inStringInboxYesTo specify a nested IMAP folder, enter the folder hierarchy by using backslashes (for example, Project\Meetings)

ReadMail

Reads a message and returns its details, including subject, body, sender (from), recipients in the CC field, recipients in the BCC field, and the number of attachments.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?
MailObjectMailObject that gives the details of the last message receivedData inObjectObjectYes
SubjectSubject of the messageData outStringNoneNo
BodyBody of the messageData outStringNoneNo
SenderSender of the messageData outStringNoneNo
CCRecipients marked in CCData outStringNoneNo
BCCRecipients marked in BCCData outStringNoneNo
AttachmentsCountNumber of attachments in the messageData outIntegerNoneNo

ReplyMail

Automatically replies to a message. Use the parameters to set the body of the message and other details. You can include attachments.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?Notes
MailObjectMessage object containing the message detailsData inObjectObjectYes 
ReplyToAllReplies to all recipients in the To and CC fields of the messageData inBooleanFalseNo 
BCCReplies to all recipients in the BCC field of the messageData inStringNoneNo 
BodyBody of the reply messageData inStringNoneNo 
IsHtmlBodyOption to indicate whether the reply body is in HTML formatData inBooleanFalseNo 
AttachmentsAttachments to the reply messageData inStringNoneNoTo attach a file:1. Paste the path to the file in the field. 2. Remove the quotes enclosing the path. To include multiple attachments, separate the paths by commas.

SaveAllAttachments

Saves all attachments from a message to the local drive.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?
MailObjectMessage that the method downloads the attachments fromData InObjectObjectYes
FolderPathPath of the directory to which the attachments are downloadedData InStringNoneYes

SendMail

Sends a message. Use the parameters to set the body of the message and other details. You can include attachments.

Note: Use the SetConfig method to set the From address.

For information about how to set the parameters, see Configure port properties.

ParameterDescriptionData port typeData typeDefault valueRequired?Notes
ToAddressAddress to which to send the messageData inStringNoneYes 
CCAddresses to include in the CC fieldData inStringNoneNo 
BCCAddresses to include in the BCC fieldData inStringNoneNo 
SubjectMessage subjectData inStringNoneNo 
BodyMessage bodyData inStringNoneNo 
IsHtmlBodyOption to indicate whether the reply body is in HTML formatData inStringFalseNo 
AttachmentsMessage attachmentsData inStringNoneNoTo attach a file:1. Paste the path to the file in the field. 2. Remove the quotes enclosing the path. To include multiple attachments, separate the paths by commas.

Parent Topic:Email connector