Skip to main content

No project description provided

Project description

SMTPc

smtpc version smtpc license smtpc python compatibility say thanks!

SMTPc is simple SMTP client for easy mail sending. It's purpose is to help developers test and/or verify SMTP servers or configuration. It's also useful if you are sending email of constant content from daemons or other crons.

If you like this tool, just say thanks.

Current stable version

0.5.0

Features

  • Easily build email message as text/plain, text/html or full MIME message (multipart/alternative)
  • Handles SMTP authentication, SSL and TLS
  • Profiles allows you to use predefined SMTP servers
  • Predefine messages set and use them for sending
  • Allow for using different from/to email addresses for SMTP session and email headers
  • Allow specifying own email headers
  • Allow using particular IP address in case when your host has more then one
  • It's all Python!

Installation

SMTPc should work on any POSIX platform where Python is available, it means Linux, MacOS/OSX etc.

Simplest way is to use Python's built-in package system:

python3 -m pip install smtpc

You can also use pipx if you don't want to mess with system packages and install SMTPc in virtual environment:

pipx install smtpc

Voila!

Python version

SMTPc is tested against Python 3.7+. Older Python versions may work, or may not.

How to use

First, add some account you want to use for sending. In this example we are using Sendria run on local environment:

smtpc profiles add sendria --host 127.0.0.1 --port 1025

You can verify:

smtpc profiles list

Now, add few messages for future use:

smtpc messages add plain --subject 'Some plain email' --body-plain 'Some plain message body' --from smtpc@example.com --to receiver@example.net
smtpc messages add html --subject 'Some html email' --body-html 'Some <b>HTML</b> message body' --from smtpc@example.com --to receiver@example.net
smtpc messages add alternative --subject 'Some alternative email' --body-plain 'Some plain message body' --body-html 'Some <b>HTML</b> message body' --from smtpc@example.com --to receiver@example.net

You can verify:

smtpc messages list

Now, send something:

smtpc send --profile sendria --message alternative
smtpc send --profile sendria --message plain --subject 'Changed subject for plain'

In second example above, we are using predefined message plain, but with changed subject.

Of course, if you don't want, you don't need to use predefined profiles and/or messages, you can pass them directly when sending:

smtpc send --host 127.0.0.1 --port 1025 --body-type html --subject 'Some html email' --body-html 'Some <b>HTML</b> message body' --from smtpc@example.com --to receiver@example.net

But it's not so funny :)

Authors

Contact

If you like or dislike this software, please do not hesitate to tell me about this me via email (marcin@urzenia.net).

If you find bug or have an idea to enhance this tool, please use GitHub's issues.

ChangeLog

v0.5.0

  • safe writing config files: will show file content if writing will fail
  • messages list is simplified by default (just message name like in profiles list)
  • new commands: smtpc profiles delete, smtpc messages delete - self explanatory I guess :)
  • few minor bugs squashed
  • few internal changes and improvements

v0.4.1

  • fixed handling --ssl and --tls when sending message using profile
  • added simple --dry-run option
  • added --reply-to option
  • minor fixes to error handling
  • added User-Agent header to generated messages

v0.4.0

  • BC: renamed command: profile -> profiles
  • added new command: messages for managing of saved email messages
  • allow overwriting profile or message predefined options from CLI arguments
  • cleaner and more elegant code

v0.3.0

  • using commands now instead of dozens of CLI arguments

v0.2.0

  • added profiles

v0.1.1

  • fixed --version

v0.1.0

  • very initial version

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

smtpc-0.5.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

smtpc-0.5.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file smtpc-0.5.0.tar.gz.

File metadata

  • Download URL: smtpc-0.5.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for smtpc-0.5.0.tar.gz
Algorithm Hash digest
SHA256 665229ded5c70bd8be5a54904e5eb24372f3be28ae81e6d05986902f3181b3ff
MD5 a0f98d1e42cb76e9b461d0b42a84020e
BLAKE2b-256 89da81b977fac9b8dbd1ea70f03dbfa8c0bf36d0b50bc1c7361090cd57da6cc6

See more details on using hashes here.

File details

Details for the file smtpc-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: smtpc-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for smtpc-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a95a479cb11b68e9109fc93417ee03b5e390155dcecf2984b5dcfcfddf5972b
MD5 44086024e60637a74e4a56a5b9646f37
BLAKE2b-256 7415731a0f65249c8c0a8978c04e9f2f3adf494345ce473f08fd8fd3683a1d9b

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