Skip to main content

An EmailSender type and related utility functions

Project description

Email Sender Utils

PyPI version

An EmailSender type and related utility functions

Project links

Features

  • build_message() — assemble a email.message.EmailMessage from addresses, headers, a body, and optional text/PDF/WAV attachments.
  • mailsend() — send a prepared message over SMTP, with optional STARTTLS and authentication.

Usage

import emailsenderutils

msg = emailsenderutils.build_message(
    fromaddr='me@example.com',
    toaddr_list=['dest@example.com', 'bcc@example.com'],
    fromline='My Name <me@example.com>',
    toline='My Destination <dest@example.com>',
    subjline='The Subject',
    body='The message body',
)

Documentation

API documentation is auto-generated from docstrings.

Development

To set up for local development:

# Clone the repository
git clone git@gitlab.com:sck/emailsenderutils.git EmailSenderUtils
cd EmailSenderUtils

# Create a virtual environment and install all development dependencies
make venv
source venv/bin/activate
make init
make sync-devci

Run quality checks (format, lint, type check, test):

make qa

Release cycle

  1. Edit code and add change notes to the Next Release (TBD) entry in HISTORY.md as you go.

  2. When ready to release, upgrade all dependencies and refresh the environment:

    make update
    make sync-devci
    
  3. Run the full quality check suite:

    make qa
    
  4. In HISTORY.md, replace the Next Release (TBD) heading with the release version and today's date, and verify the change notes are complete.

  5. Sync the version to pyproject.toml and uv.lock:

    make set-version
    
  6. Commit the release:

    git commit -am "Release X.Y.Z"
    
  7. Tag and push. make tag validates version consistency across HISTORY.md, pyproject.toml, and uv.lock; creates an annotated tag; pushes it to origin; and adds a new Next Release (TBD) entry to HISTORY.md:

    make tag
    

    Pushing the tag triggers the GitLab CI/CD publish job, which uploads the package to your selected registry.

  8. Commit to open the next development cycle:

    git commit -am "Start next development cycle"
    
  9. Go back to step 1.

See Release Checklist for the full recurring workflow.

License

MIT.

Acknowledgements

Built with Cookiecutter and the sck/cookiecutter-pypackage-gitlab project template.

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

emailsenderutils-0.0.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

emailsenderutils-0.0.1-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file emailsenderutils-0.0.1.tar.gz.

File metadata

  • Download URL: emailsenderutils-0.0.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for emailsenderutils-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9b98702e9f0d85eb37b55f075e8edf0800c025dc63642657057c0af50600cac8
MD5 9e7a5962d1f998222ac05f2c71e1357c
BLAKE2b-256 df2848359a4d92f4bd34e9f6fc8d844025c19d8ee998b47ac24d7383a736b6fe

See more details on using hashes here.

File details

Details for the file emailsenderutils-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: emailsenderutils-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for emailsenderutils-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86278637fdd203d5e383e54efe298aa07a59f3dd2602296b7851a74835768171
MD5 7b3ef0c46702d69c8d68adb9446ad09a
BLAKE2b-256 b4f191742a767056750a26a185b8802d8d587507cfce17bdd11373ab7cab39b0

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