Authorize

Connect to Exchange account

Arguments

Argument Type Default value Description
usernamestrnull
passwordstrnull
autodiscoverboolTrue
access_typestrDELEGATE
serverstr, NoneNone
primary_smtp_addressstr, NoneNone
param username:account username
param password:account password
param autodiscover:
 use autodiscover or set it off
param accesstype:
 default "DELEGATE", other option "IMPERSONATION"
param server:required for configuration options
param primary_smtp_address:
 by default set to username, but can be set to be different than username

Create Folder

Create email folder

Arguments

Argument Type Default value Description
folder_namestr, NoneNone
parent_folderstr, NoneNone
param folder_name:
 name for the new folder
param parent_folder:
 name for the parent folder, by default INBOX
return:True if operation was successful, False if not

Delete Folder

Delete email folder

Arguments

Argument Type Default value Description
folder_namestr, NoneNone
parent_folderstr, NoneNone
param folder_name:
 current folder name
param parent_folder:
 name for the parent folder, by default INBOX
return:True if operation was successful, False if not

Empty Folder

Empty email folder of all items

Arguments

Argument Type Default value Description
folder_namestr, NoneNone
parent_folderstr, NoneNone
delete_sub_foldersboolFalse
param folder_name:
 current folder name
param parent_folder:
 name for the parent folder, by default INBOX
param delete_sub_folders:
 delete sub folders or not, by default False
return:True if operation was successful, False if not

List Messages

List messages in the account inbox. Order by descending received time.

Arguments

Argument Type Default value Description
folder_namestr, NoneNone
criterionstr, NoneNone
containsboolFalse
countint100
save_dirstr, NoneNone

List messages in the account inbox. Order by descending received time.

param folder_name:
 name of the email folder, default INBOX
param criterion:
 list messages matching criterion
param contains:if matching should be done using contains matching and not equals matching, default False is means equals matching
param count:number of messages to list
param save_dir:set to path where attachments should be saved, default None (attachments are not saved)

List Unread Messages

List unread messages in the account inbox. Order by descending received time.

Arguments

Argument Type Default value Description
folder_namestr, NoneNone
criterionstr, NoneNone
containsboolFalse
countint100
save_dirstr, NoneNone

List unread messages in the account inbox. Order by descending received time.

param folder_name:
 name of the email folder, default INBOX
param criterion:
 list messages matching criterion
param contains:if matching should be done using contains matching and not equals matching, default False is means equals matching
param count:number of messages to list
param save_dir:set to path where attachments should be saved, default None (attachments are not saved)

Move Message

Move a message into target folder

Arguments

Argument Type Default value Description
msgdictnull
targetstrnull
param msg:dictionary of the message
param target:path to target folder
raises AttributeError:
 if msg is not a dictionary containing id and changekey attributes

Examples

*** Tasks ***
${messages}=    List Messages
...    INBOX
...    criterion=subject:about my orders
FOR    ${msg}    IN    @{messages}
    Run Keyword If    "${msg}[sender][email_address]"=="${priority_account}"
    ...    Move Message    ${msg}    target=INBOX / Problems / priority
END

Move Messages

Move message(s) from source folder to target folder

Arguments

Argument Type Default value Description
criterionstr
sourcestr, NoneNone
targetstr, NoneNone
containsboolFalse
param criterion:
 move messages matching this criterion
param source:source folder
param target:target folder
param contains:if matching should be done using contains matching and not equals matching, default False is means equals matching
return:boolean result of operation, True if 1+ items were moved else False

Criterion examples:

  • subject:my message subject
  • body:something in body
  • sender:sender@domain.com

Rename Folder

Rename email folder

Arguments

Argument Type Default value Description
oldnamestr, NoneNone
newnamestr, NoneNone
parent_folderstr, NoneNone
param oldname:current folder name
param newname:new name for the folder
param parent_folder:
 name for the parent folder, by default INBOX
return:True if operation was successful, False if not

Save Attachments

Save attachments in message into given directory

Arguments

Argument Type Default value Description
messagedictnull
save_dirstr, NoneNone
param message:dictionary containing message details
param save_dir:filepath where attachments will be saved
return:list of saved attachments

Send Message

Keyword for sending message through connected Exchange account.

Arguments

Argument Type Default value Description
recipientsstrnull
subjectstr
bodystr
attachmentsstr, NoneNone
htmlboolFalse
imagesstr, NoneNone
ccstr, NoneNone
bccstr, NoneNone
saveboolFalse
param recipients:
 list of email addresses, defaults to []
param subject:message subject, defaults to ""
param body:message body, defaults to ""
param attachments:
 list of filepaths to attach, defaults to []
param html:if message content is in HTML, default False
param images:list of filepaths for inline use, defaults to []
param cc:list of email addresses, defaults to []
param bcc:list of email addresses, defaults to []
param save:is sent message saved to Sent messages folder or not, defaults to False

Email addresses can be prefixed with ex: to indicate an Exchange account address.

Recipients is a required parameter.

Wait For Message

Wait for email matching `criterion` to arrive into INBOX.

Arguments

Argument Type Default value Description
criterionstr
timeoutfloat5.0
intervalfloat1.0
containsboolFalse
save_dirstr, NoneNone

Wait for email matching criterion to arrive into INBOX.

param criterion:
 wait for message matching criterion
param timeout:total time in seconds to wait for email, defaults to 5.0
param interval:time in seconds for new check, defaults to 1.0
param contains:if matching should be done using contains matching and not equals matching, default False is means equals matching
param save_dir:set to path where attachments should be saved, default None (attachments are not saved)
return:list of messages