https://github.com/matgou/txttomail
A customizable tool to send HTML mail from bash command line, with attachments, images, arrays, inside.
https://github.com/matgou/txttomail
cli html java mailer shell smtp
Last synced: 3 months ago
JSON representation
A customizable tool to send HTML mail from bash command line, with attachments, images, arrays, inside.
- Host: GitHub
- URL: https://github.com/matgou/txttomail
- Owner: matgou
- Created: 2017-05-05T17:46:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T19:49:02.000Z (over 4 years ago)
- Last Synced: 2025-04-06T09:46:39.775Z (6 months ago)
- Topics: cli, html, java, mailer, shell, smtp
- Language: Java
- Homepage:
- Size: 161 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TxtToMail
A customizable java tools to send HTML mail from command line. With attachments, images, arrays, inside.
[](https://travis-ci.org/matgou/txttomail)
[](https://codecov.io/github/matgou/txttomail?branch=master)## Usage via command line :
### All in one command :
You can send email via one command :
```bash
java -jar TxtToMail.jar --send -TO "matgou@kapable.info" -SUBJECT "this is a test" -TEXT "Hy,
This is a test mail!"
```### Step by step command :
Or you can run multiple command (for shell script usage)
* First step is to produce a file "mail.template" containing mail information
```bash
java -jar TxtToMail.jar -i mail.template -FROM matgou@kapable.info
java -jar TxtToMail.jar -i mail.template -TO test@kapable.info
java -jar TxtToMail.jar -i mail.template -SUBJECT "This is a test"
java -jar TxtToMail.jar -i mail.template -TEXT "Hy,
"
java -jar TxtToMail.jar -i mail.template -TEXT "This is a test mail !"
java -jar TxtToMail.jar -i mail.template -ARRAY "src/main/resources/tab1.csv"
java -jar TxtToMail.jar -i mail.template -PJ "src/main/resources/tab1.csv"
```* Second step to send mail, type this command to keep copy of mail in "output.eml" file
```bash
java -jar TxtToMail.jar -i mail.template -o output.eml -send
```## Configuration
You can specify some extra option like smtp-host by creating a .properties file and use it with "-c" option :
* A config.properties file :
```
mail.smtp.host=smtp.myisp.com
logfile=mail.log
```
* Send the mail previously prepared :
```bash
java -jar TxtToMail.jar -c config.properties -i mail.template -o output.eml -send
```## Customizing
TODO
## Building from source
To build from source use mvn :
```bash
mvn clean test package
```