Skip to main content

A simple e-mail sender in Python

Project description

simplemail

A simple e-mail sender in Python

Getting Started

This project provides a simple and portable python script which can be used to send e-mails by SMTP.

It will use the parameters received as arguments to process the mail request.

Prerequisites

Python 3 installation with smtplib

Installing

Just copy the file simpleMail.py to your preferred working directory and call it with their Python 3 interpreter

cp src/simpleMail.py YOUR_DIRECTORY

Execution

In order to execute the simplemail use:

python simpleMail.py [ARGS]

Where the minimal arguments are:

-f [MAIL_ADDRESS]     # The sender email address
                    
-t [MAIL_ADDRESSESS]  # The recipient email address(es)

It's possible to store the default values for SMTP, MESSAGE and LOGGING in a config.ini file to avoid passing them in command line everytime. Check the internal docs on configuration_example.ini to know how to configure it

python simpleMail.py -f "from@example.com" -t "to@exmple.com" -c "templates/configuration_example.ini"

Optional arguments:

-c [CONFIG_FILE]      # The configuration file in INI format

-m [MESSAGE ...]      # The message content (body). It can be a file with the content or a string with the raw text

-xu [USERNAME]        # The username for SMTP authentication

-xp [PASSWORD]        # The password for SMTP authentication

-cc [MAIL_ADDRESS ...]   # The cc email address(es)

-bcc [MAIL_ADDRESS ...]  # The bcc email address(es)

-u [SUBJECT]             # The message subject. Default = "(no subject)"

-s SERVER[:PORT],        # The smtp server in the format "host:port". Default = localhost:25

-a [FILE ...]            # File attachment(s)

--tls <true|false|auto>  # Whether use TLS or not. Default = auto

--ssl <true|false|auto>  # Whether use SSL or not. Default = auto

--content-type [TYPE]    # The message body type. Default = "text/html"

--charset [CHARSET]      # The message body character encoding. Default = "utf-8"

--log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL]   # The log level. Defatult = INFO

--log-file [FILE]        # log into a file instead of using STDOUT.

--smtp-debug <true|false> # whether to enable debugging for SMTP communication. Default = false

The complete list of arguments can be found by executing:

python simpleMail.py --help

Authors

  • Jonathan Gangi - Initial work - JAVGan

License

This project is licensed under the GNU LESSER GENERAL PUBLIC LICENSE v2.1 - see the LICENSE file for details

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

simplemail_python3-1.0.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

simplemail_python3-1.0.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file simplemail_python3-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for simplemail_python3-1.0.0.tar.gz
Algorithm Hash digest
SHA256 80ba5a745a44f5922834692c6b03617295325d88d6682dfba8b837105c21bb53
MD5 301ce4ae4fb6ae4b2e3a29967f02faad
BLAKE2b-256 9756b9c09d969440d5d32033a3500f1b1135badf3525a0dbcedd61ca3578bbf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplemail_python3-1.0.0.tar.gz:

Publisher: publish.yml on JAVGan/simplemail

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

File details

Details for the file simplemail_python3-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simplemail_python3-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71781913fdb614f9108d8173bf16421eb9eb3b4305a2d7f344b2e97be12d6b8c
MD5 86ce9fbc7ca613073f9e5df7e278e1c5
BLAKE2b-256 c0204e4ed2bdf018a66520404afc08aa5564ef0d6017cfbc86a063beb4732e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for simplemail_python3-1.0.0-py3-none-any.whl:

Publisher: publish.yml on JAVGan/simplemail

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