This is a fork of Rick Harris’s tinysmtp package with a few fixes and Python 3 compatibility.
Example:
with Mail().connect() as mail:
msg = Message(
'alice@example.com', 'Subject', ['bob@example.com'], body='body')
mail.send(msg)
Connections may be configured from a URL specified in an environment variable:
export MAILSEND_URL="smtp+tls://user:password@server.example.org/"
Or as individual variables:
export MAILSEND_HOSTNAME=server.example.org export MAILSEND_PORT=25
Or in code:
mail = Mail('smtp://server.example.org/')
mail2 = Mail('server.example.org',
port=25,
ssl=True,
username='x',
password='x')
Call mail.send to send a message:
mail = Mail('smtp://server.example.org/')
mail.send(sender='alice@example.com',
recipients=['bob@example.com', 'charlie@example.com'],
body='Hello everyone!',
html='<p>Hello everyone!</p>',
subject='Hello')
Or use the message class to construct messages piecemeal:
msg = Message('alice@example.com', 'Hello!')
msg.body = 'Hello'
msg.recipients = ['bob@example.com']
msg.cc = ['charlie@example.org']
msg.bcc = ['dina@example.org']
mail = Mail('smtp://server.example.org/')
mail.send(msg)
To send multiple messages in a single connection, use Mail.connect:
with mail.connect() as conn:
conn.send(msg1)
conn.send(msg2)
Metadata
Release files for mailsend 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mailsend-2.0.0.tar.gz | 10.2 kB | Without provenance | Details for mailsend-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mailsend-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for mailsend-2.0.0-py3-none-any.whl |
Total release size: 18.3 kB
Release files / mailsend-2.0.0.tar.gz
| Download URL | mailsend-2.0.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f84f6e97b3305b6eca72c88d52a95cf6cf7d065a67e0e838b45891063c40adf
|
|
BLAKE2b-256 checksum How to use checksums |
8856bab2e6fb97a89415349a42f15cffef990e66f58627b3432b5c3a031554bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Release files / mailsend-2.0.0-py3-none-any.whl
| Download URL | mailsend-2.0.0-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0ed099382d0242674c22a12b5177b2c8a4a2ceb2b7693362e9bf8a83e118fd1
|
|
BLAKE2b-256 checksum How to use checksums |
4d6e3d7c32f9a9e922160fa4bc0348f49b8ae2a461a643842306ff8bfff0d972
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.13
|
Security for mailsend 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.