A simple command line interface (CLI) for sending emails using SMTP.
Please install this via git
:
pip install git+https://github.com/LiHRaM/mailer.git
This application can be run from the command line with the command mailer
, followed by the necessary options.
The application accepts the following options:
--to
: The email address to send the email to (required).--subject
: The subject of the email (required).--username
: The SMTP username (required). Can also be set with theSMTP_USERNAME
environment variable.--password
: The SMTP password (required). Can also be set with theSMTP_PASSWORD
environment variable. You will be prompted to enter it securely.--body
: The body of the email. This option is mutually exclusive with--body-path
.--body-path
: A path to a text file containing the body of the email. This option is mutually exclusive with--body
.--server
: The SMTP server to use. Defaults tosmtp.gmail.com
.--port
: The SMTP port to use. Defaults to587
.
To send an email:
export SMTP_USERNAME=yourusername@gmail.com
mailer --to receiver@example.com --subject "Hello" --body "This is the body of the email."
When you run this command, you will be prompted to enter your SMTP password.