Send/Save Emails & Attachments via Outlook
Project description
Exchange Web Server
This project contains the basic files to send and save an email/attachment through the module exchangelib
.
Installation
Note that the module requires Python 3.6
or higher.
To install the module, run a pip command like the following:
pip install exchange-web-server
Setting .env Variables
To work properly, this module needs your companies:
- tenant_id
- client_id
- client_secret
Usage create_account
Simply import the modules via the following import statements:
from exchange-web-server import create_account
account = create_account('user@provider.com')
The create_account
function requires your Outlook-Exchange email-address.
Usage send
Simply import the modules via the following import statements:
from exchange-web-server import send_email
The send_email
function requires your account, subject, body, recipients and optional attachments.
To send an email, the following code provides the core functionality:
send_email(account, 'TestSubject', 'TestBody', ['recepient@provider.com'], ['path/to/your/attachments'])
Usage save
Simply import the modules via the following import statements:
from exchange-web-server import save_attachment
The save_attachment
function requires your Outlook Exchange Folder, which needs to be located in your inbox. Also it needs a path where to save and an exchangelib account.
To save an attachment, the following code provides the core functionality:
save_attachment(account, 'TestSubject', 'TestBody', ['recepient@provider.com'])
License
This project is licensed by a MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for exchange-web-server-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d83219af7165cd28b6df05008f66c0324886ac938f466b6bac229d815945b366 |
|
MD5 | 11b9a9a123e44febad964cf5f06e3c90 |
|
BLAKE2b-256 | 32dc5ff7c3ef8d636d699b0a6503d57e3001d160cf2870a2b074116e33f34724 |
Hashes for exchange_web_server-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9a433419d075ee62d2e2afaf22b25e681b3207eb41977bac89ec1b4d535cdc4 |
|
MD5 | 7e05bcc0d4c241b1f9e5ca4ba9f422cb |
|
BLAKE2b-256 | e1723c83e3ae82cbbcc9ba7354443923b2042070ada857b42f811d412f4df389 |