wmul_emailer
Utility to send an email to multiple addresses. Primarily intended for cli applications. The various fields such as server host, username, etc. are entered at the command line, used to construct a wmul_emailer.EmailSender object, and that object is passed into the main part of the script. The main part of the script can use it as needed to report errors or results without having to worry about the e-mail details.
A cli is provided for testing purposes.
class EmailSender(server_host, port, user_name, password, from_email_address=None, destination_email_addresses=None)
server_host The hostname or ip address of the smtp server.
port The port number on which the smtp server resides.
user_name The username to authenticate with the smtp server.
password The password to authenticate with the smtp server.
from_email_address=None The 'from' e-mail address.
destination_email_addresses=None The e-mail address to which the results should be sent. Must be a list or tuple for multiple addresses, or a str for a single address.
send_email(self, email_body, email_subject, from_email_address=None, destination_email_addresses=None)
email_body The body of the e-mail to be sent.
email_subject The subject line of the e-mail to be sent.
from_email_address=None The 'from' e-mail address, if provided here. If a from_email_address is not included when calling this method, the one provided to the constructor will be used.
destination_email_addresses=None The e-mail address to which the results should be sent, if provided here. If destination_email_addresses are not included when calling this method, the ones provided to the constructor will be used. Must be a list or tuple for multiple addresses, or a str for a single address.
Raises ValueError if either destination_email_addresses or from_email_address are omitted from both the constructor and the call to send_email.
Command-Line Interface
A cli is provided to test that the credentials are functional and that the system can send e-mails.
send_test_email --email destination@example.com --server smtp.example.com --port 25 --username myusername --password mypassword --from_address source@example.com
If everything works, then destination@example.com will receive an e-mail from source@example.com with the subject Test e-mail from wmul_emailer and body This is the test e-mail from wmul_emailer.py. If you are reading this, the software is configured correctly.
Metadata
Release files for wmul_emailer 0.6.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 |
|---|---|---|---|---|
| wmul_emailer-0.6.0.tar.gz | 19.0 kB | Without provenance | Details for wmul_emailer-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wmul_emailer-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for wmul_emailer-0.6.0-py3-none-any.whl |
Total release size: 37.0 kB
Release files / wmul_emailer-0.6.0.tar.gz
| Download URL | wmul_emailer-0.6.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c9a447e59c8386f30ad4b6c74b3bee81ea414c0b3943314188b248065d386a9
|
|
BLAKE2b-256 checksum How to use checksums |
d78c2775164c801c6b3b3ffeb9d4938dc3ac3ff65788a6a9767bdcca94d6c841
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.2
|
Release files / wmul_emailer-0.6.0-py3-none-any.whl
| Download URL | wmul_emailer-0.6.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3f801b30f2f6d1c40d4a37a492039a569d639f1f24431a5075fcd9025d48ad6
|
|
BLAKE2b-256 checksum How to use checksums |
0e978c268f9b54fe218eb0cf3a1950b7e3c29a10e0f3fd43af37ddde8ad60795
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.2
|
Security for wmul_emailer 0.6.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.