Skip to main content

Simple library to send emails

Project description

Rick-mailer - Library to send emails

Tests pypi license

rick_mailer is a standalone version of Django's email library implementation, with minor changes.

Installation

$ pip3 install rick-mailer

Usage

from rick_mailer import SMTPFactory, Mailer

cfg = {
    'smtp_host': '127.0.0.1',
    'smtp_port': 25,
    'smtp_username': 'relay@local',
    'smtp_password': 'securePassword',
    'smtp_use_tls': False,
    'smtp_use_ssl': False,
}
conn = SMTPFactory(cfg)

mailer = Mailer(conn)
mailer.send_mail('some subject', 'message contents', 'noreply@localhost', ['user1@domain.tld', 'user2@domain.tld'])

Configuration options

SMTPFactory(cfg) reads the following keys from cfg:

Key Default Description
smtp_host 'localhost' SMTP server hostname.
smtp_port 25 SMTP server port.
smtp_username '' Username for authentication (empty disables login).
smtp_password '' Password for authentication.
smtp_use_tls False Use STARTTLS on a plain connection.
smtp_use_ssl False Use an implicit TLS (SSL) connection. Mutually exclusive with smtp_use_tls.
smtp_timeout None Socket timeout in seconds.
smtp_ssl_keyfile None Path to a client-side private key (PEM).
smtp_ssl_certfile None Path to a client-side certificate (PEM); required when smtp_ssl_keyfile is set.

Security note: smtp_use_tls and smtp_use_ssl default to False. When sending credentials (smtp_username/smtp_password), enable one of them (smtp_use_tls=True for STARTTLS, or smtp_use_ssl=True for an implicit TLS connection) so the password is not transmitted in cleartext.

Related tools

Check out Mailpit, a mail testing tool for developers.

License

As rick_mailer is mostly Django code, it is licensed under Django license and copyright - see the included License file.

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

rick_mailer-1.1.2.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

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

rick_mailer-1.1.2-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file rick_mailer-1.1.2.tar.gz.

File metadata

  • Download URL: rick_mailer-1.1.2.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rick_mailer-1.1.2.tar.gz
Algorithm Hash digest
SHA256 1ad40abf2531f3daada4fdab4aeff99738263f9bfad5c25235451e4242618183
MD5 aa16c5852eedff8d0c16df5e385e0112
BLAKE2b-256 b8466ebcd0014423e519abca5c2f26d6ab797414c2a0d9ab4638c5cbfab7b1ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for rick_mailer-1.1.2.tar.gz:

Publisher: publish.yml on oddbit-project/rick-mailer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rick_mailer-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: rick_mailer-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rick_mailer-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3dbd85f662ddbb8aec243cdfb5afe694bf66d264d8def1c73239c113fe829758
MD5 2ca3929a06694602bfe42a0ecbea4ade
BLAKE2b-256 3a482d7161bcb8c23946eac0b9d47a334625c58d725c53b08f5672f325cf887e

See more details on using hashes here.

Provenance

The following attestation bundles were made for rick_mailer-1.1.2-py3-none-any.whl:

Publisher: publish.yml on oddbit-project/rick-mailer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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