Authorize

Arguments

  • username: str
  • password: str
  • autodiscover: bool = True
  • access_type: str = DELEGATE
  • server: str = None
  • primary_smtp_address: str = None

Connect to Exchange account

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

Arguments

  • folder_name: str = None
  • parent_folder: str = None

Create email folder

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

Arguments

  • folder_name: str = None
  • parent_folder: str = None

Delete email folder

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

Arguments

  • folder_name: str = None
  • parent_folder: str = None
  • delete_sub_folders: bool = False

Empty email folder of all items

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

Arguments

  • folder_name: str = None
  • count: int = 100

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

param count:number of messages to list

Move Messages

Arguments

  • criterion: str =
  • source: str = None
  • target: str = None
  • contains: bool = False

Move message(s) from source folder to target folder

Criterion examples:

  • subject:my message subject
  • body:something in body
  • sender:sender@domain.com
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

Rename Folder

Arguments

  • oldname: str = None
  • newname: str = None
  • parent_folder: str = None

Rename email folder

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

Send Message

Arguments

  • recipients: str
  • subject: str =
  • body: str =
  • attachments: str = None
  • html: bool = False
  • images: str = None
  • cc: str = None
  • bcc: str = None
  • save: bool = False

Keyword for sending message through connected Exchange account.

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

Recipients is required parameter.

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

Wait For Message

Arguments

  • criterion: str =
  • timeout: float = 5.0
  • interval: float = 1.0
  • contains: bool = False

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
return:list of messages