Skip to main content

A Simple Email Dispatcher based on top of win32Api

Project description

Outlook Email Dispatcher

A Simple Email Dispatcher based on top of win32Api

Installation

pip install pyoutlookdispatcher

Examples of Usage:

Send Email with Attachments

By default it adds your signature if you have one.

import os
from pyoutlookdispatcher import Outlook, Mail

FILES_TO_ATTACH_FOLDER = os.path.join(os.getcwd(), 'files_to_attach')
ATTACHMENTS = [os.path.join(FILES_TO_ATTACH_FOLDER, f) for f in os.listdir(FILES_TO_ATTACH_FOLDER)]

mail = Mail(
    Subject="Teste",
    To="example@example.com",
    HTMLBody="Teste",
    CC="example@example.com",
    Attachments=ATTACHMENTS
)

outlook = Outlook()
outlook.send(mail)

Send Email without Signature

from pyoutlookdispatcher import Outlook, Mail

mail = Mail(
    Subject="Teste",
    To="example@example.com",
    HTMLBody="Teste",
    CC="example@example.com",
    Attachments=ATTACHMENTS,
    Signature=False
)

outlook = Outlook()
outlook.send(mail)

Preview an Email

from pyoutlookdispatcher import Outlook, Mail

mail = Mail(
    Subject="Teste",
    To="example@example.com",
    HTMLBody="Teste",
    CC="example@example.com",
    Attachments=ATTACHMENTS,
)

outlook = Outlook()
outlook.preview(mail)

Object Mail Params:

Subject: str
To: str
HTMLBody: str
CC: Optional[str] = None
Attachments: Optional[List[str]] = field(default_factory=list)
Signature: Optional[bool] = True

Short Use Cases:

Initialize Outlook

Instanciate an Object from Outlook Class

outlook = Outlook()

Preview Mail:

outlook.preview(mail)

Send Mail:

outlook.send(mail)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyOutlookDispatcher-0.2.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PyOutlookDispatcher-0.2.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file PyOutlookDispatcher-0.2.1.tar.gz.

File metadata

  • Download URL: PyOutlookDispatcher-0.2.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.0 Windows/10

File hashes

Hashes for PyOutlookDispatcher-0.2.1.tar.gz
Algorithm Hash digest
SHA256 0ad824f4ad0095f2d4517b3b5512f9e4be281f525b58229ab83cb34a6dd34818
MD5 d0a4decd9ee403b4c9c0c8db608b930f
BLAKE2b-256 c338e8beb6e93410ca5cffc1cc60877ecc213e400934900292e521594c170b45

See more details on using hashes here.

File details

Details for the file PyOutlookDispatcher-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for PyOutlookDispatcher-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32147e167d93f6f0b6f09a9a3543e3e449252243e82684d7e120c18e9f2e7239
MD5 83b1531247351ab014dc308150360d71
BLAKE2b-256 db695a85ca6f3726336d0e299e6f850473ab5e9a16c390f465a09e12a165973e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page