Authorize
Connect to Exchange account
Arguments
Argument | Type | Default value | Description |
---|---|---|---|
username | str | null | |
password | str | null | |
autodiscover | bool | True | |
access_type | str | DELEGATE | |
server | str, None | None | |
primary_smtp_address | str, None | None |
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_name | str, None | None | |
parent_folder | str, None | None |
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_name | str, None | None | |
parent_folder | str, None | None |
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_name | str, None | None | |
parent_folder | str, None | None | |
delete_sub_folders | bool | False |
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_name | str, None | None | |
criterion | str, None | None | |
contains | bool | False | |
count | int | 100 | |
save_dir | str, None | None |
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_name | str, None | None | |
criterion | str, None | None | |
contains | bool | False | |
count | int | 100 | |
save_dir | str, None | None |
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 |
---|---|---|---|
msg | dict | null | |
target | str | null |
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 |
---|---|---|---|
criterion | str | ||
source | str, None | None | |
target | str, None | None | |
contains | bool | False |
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 |
---|---|---|---|
oldname | str, None | None | |
newname | str, None | None | |
parent_folder | str, None | None |
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 |
---|---|---|---|
message | dict | null | |
save_dir | str, None | None |
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 |
---|---|---|---|
recipients | str | null | |
subject | str | ||
body | str | ||
attachments | str, None | None | |
html | bool | False | |
images | str, None | None | |
cc | str, None | None | |
bcc | str, None | None | |
save | bool | False |
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 |
---|---|---|---|
criterion | str | ||
timeout | float | 5.0 | |
interval | float | 1.0 | |
contains | bool | False | |
save_dir | str, None | None |
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 |