https://github.com/httprunner/mail-cli
Send email in command shell, especially used in Jenkins.
https://github.com/httprunner/mail-cli
jenkins-mail mailer mailgun
Last synced: 6 months ago
JSON representation
Send email in command shell, especially used in Jenkins.
- Host: GitHub
- URL: https://github.com/httprunner/mail-cli
- Owner: httprunner
- License: mit
- Created: 2017-07-17T13:50:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-15T15:50:34.000Z (about 7 years ago)
- Last Synced: 2025-04-13T04:16:50.658Z (6 months ago)
- Topics: jenkins-mail, mailer, mailgun
- Language: Python
- Size: 20.5 KB
- Stars: 7
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mail CLI
CLI for email sending, based on mailgun service and SMTP mailer.
## Install
```bash
$ pip install -U mailcli
```## Usage
```text
$ mailcli -h
usage: mailcli [-h] [-V] [-u MAILGUN_SMTP_USERNAME]
[-p MAILGUN_SMTP_PASSWORD] [--mail-sender MAIL_SENDER]
[--mail-recepients [MAIL_RECEPIENTS [MAIL_RECEPIENTS ...]]]
[--mail-subject MAIL_SUBJECT] [--mail-content MAIL_CONTENT]
[--mail-content-path MAIL_CONTENT_PATH]Mail-CLI, send mail with mailgun service.
optional arguments:
-h, --help show this help message and exit
-V, --version show version
-u MAILGUN_SMTP_USERNAME, --mailgun-smtp-username MAILGUN_SMTP_USERNAME
Specify mailgun smtp username.
-p MAILGUN_SMTP_PASSWORD, --mailgun-smtp-password MAILGUN_SMTP_PASSWORD
Specify mailgun smtp password.
--mail-sender MAIL_SENDER
Specify email sender.
--mail-recepients [MAIL_RECEPIENTS [MAIL_RECEPIENTS ...]]
Specify email recepients.
--mail-subject MAIL_SUBJECT
Specify email subject.
--mail-content MAIL_CONTENT
Specify email content.
--mail-content-path MAIL_CONTENT_PATH
Load file content as mail content.
```## Examples
### send mail with content
```bash
$ mailcli \
-u "user@mail.com" \
-p "pwd123" \
--mail-sender "sender@mail.com" \
--mail-recepients test1@mail.com test2@mail.com \
--mail-subject subject-test \
--mail-content hello-world
```### send mail with file content
```bash
$ mailcli \
-u "user@mail.com" \
-p "pwd123" \
--mail-sender "sender@mail.com" \
--mail-recepients test1@mail.com test2@mail.com \
--mail-subject subject-test \
--mail-content-path 1534006836.html
```