Simple library to send emails
Project description
Rick-mailer - Library to send emails
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_tlsandsmtp_use_ssldefault toFalse. When sending credentials (smtp_username/smtp_password), enable one of them (smtp_use_tls=Truefor STARTTLS, orsmtp_use_ssl=Truefor 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ad40abf2531f3daada4fdab4aeff99738263f9bfad5c25235451e4242618183
|
|
| MD5 |
aa16c5852eedff8d0c16df5e385e0112
|
|
| BLAKE2b-256 |
b8466ebcd0014423e519abca5c2f26d6ab797414c2a0d9ab4638c5cbfab7b1ce
|
Provenance
The following attestation bundles were made for rick_mailer-1.1.2.tar.gz:
Publisher:
publish.yml on oddbit-project/rick-mailer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rick_mailer-1.1.2.tar.gz -
Subject digest:
1ad40abf2531f3daada4fdab4aeff99738263f9bfad5c25235451e4242618183 - Sigstore transparency entry: 1700440187
- Sigstore integration time:
-
Permalink:
oddbit-project/rick-mailer@34a54cb9e308c256895261a715e352dd24b81a2b -
Branch / Tag:
refs/tags/1.1.2 - Owner: https://github.com/oddbit-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@34a54cb9e308c256895261a715e352dd24b81a2b -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dbd85f662ddbb8aec243cdfb5afe694bf66d264d8def1c73239c113fe829758
|
|
| MD5 |
2ca3929a06694602bfe42a0ecbea4ade
|
|
| BLAKE2b-256 |
3a482d7161bcb8c23946eac0b9d47a334625c58d725c53b08f5672f325cf887e
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rick_mailer-1.1.2-py3-none-any.whl -
Subject digest:
3dbd85f662ddbb8aec243cdfb5afe694bf66d264d8def1c73239c113fe829758 - Sigstore transparency entry: 1700440306
- Sigstore integration time:
-
Permalink:
oddbit-project/rick-mailer@34a54cb9e308c256895261a715e352dd24b81a2b -
Branch / Tag:
refs/tags/1.1.2 - Owner: https://github.com/oddbit-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@34a54cb9e308c256895261a715e352dd24b81a2b -
Trigger Event:
release
-
Statement type: