Skip to main content

A Python package for authenticating to Outlook Web and sending emails using Playwright.

Project description

outwright leverages playwright as a mechanism to send emails via Outlook. It is an extension to mbox2m365 (see elsewhere) that sets up a backend mail server to which any email client can connect. New messages are processed and then playwright is used to control a web-Outlook instance to send the email.

context

Consider the case where some Company/Institution only allows the use of Outlook (or a web-based Outlook) to send and receive emails. Usually the case where a user wishes to use a different email client is not supported. Enter outright that provides the interfacing mechanism between an email composed by any client and Outlook to actually send the email.

prerequisites

outwright is part of mbox2m365, or rather a tangential extension to it. Use mboxm365 to setup the mbox file processor and the email-to-file server.

First, start up the back end email server:

cd mbox2m365/mbox2m365
python mailSinkAuth.py  --mdir /home/rudolph/tmp/mail --mbox messages.mbox --port 22225

Now, make sure the (legacy) m365 is installed. See here. Using a tool like entr setup a trigger on the mbox defined by the server:

find . | entr mbox2m365 --inputDir /home/rudolph/tmp/mail \
                        --mbox messages.mbox \
                        --sendFromFile \
                        --waitForStragglers 10 \
                        --playwright /home/rudolph/tmp/notifications/notification.txt

(note that the special --playwright directive specifies a trigger notification file to be saved to the listed location)

installation

Installation is either from a checkout of this repo or via pip.

github

For source installation, clone the repo

gh repo clone FNNDSC/outright

and then

cd outright
pip install -U ./

PyPI

Alternatively, simply do

pip install -U outlook_email_sender

running

With the backend server setup, start things with

outwright --email me@myoutlook.address \
          --password somethingSecret \
          --notification ~/tmp/notifications/notification.txt

Now, whenever the mbox2m365 detects a new message, it will parse this into the notification file, which is then parsed by outwright.

limitations

This is an early prototype. Obvious limitations are the use of a notification file that is parsed by outwright, particularly if an additional email is sent while a prior is still being processed.

-30-

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

outlook_email_sender-1.0.4.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file outlook_email_sender-1.0.4.tar.gz.

File metadata

  • Download URL: outlook_email_sender-1.0.4.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.6

File hashes

Hashes for outlook_email_sender-1.0.4.tar.gz
Algorithm Hash digest
SHA256 c239a0399c84644307c1c7504986443877b340744717512b499a962b0770ce36
MD5 d7215a402620d3b9772ca3795183e97f
BLAKE2b-256 960967ddcb9e2eb35730884bdab751ad3a7ddb1e345be8f564a15e4c634d9053

See more details on using hashes here.

Supported by

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