UNIMAIL-CLIENT

A command-line tool for sending email through unimail-go-sdk.
Chinese Docs
Features
- Reads the API key from the
UNIMAIL_KEY environment variable by default
- Supports overriding the key with
-k/--key
- Sends plain text or HTML email
- Supports multiple receivers, CC, and BCC
- Supports attachments via
--file using ; separated name/path pairs
- Supports route via
--route
- Supports
version, update, and upgrade subcommands
- Supports
-v, -V, and --version for version information
- Supports
-h/--help for usage information
Installation
Option 1: Download from Release
When the project publishes a Release, you can download the archive for your platform and unpack it locally.
Option 2: Build locally
go build -o unimail-client .
Option 3: Install on Ubuntu
After this project is uploaded to your Launchpad PPA:
sudo add-apt-repository ppa:/
sudo apt update
sudo apt install unimail-client
Replace and with your actual PPA owner/name.
Option 4: Install on Windows
Install from Winget:
winget install ACCloud.UnimailClient
Configuration
The program reads the API key from the UNIMAIL_KEY environment variable by default:
export UNIMAIL_KEY=your_key
On Windows PowerShell:
$env:UNIMAIL_KEY = "your_key"
You can also pass the key directly with -k or --key.
Usage
Show help
unimail-client -h
unimail-client --help
Send an email
unimail-client \
--route "route" \
-f "Sender Name" \
-r a@example.com \
-r b@example.com \
-c cc@example.com \
-b bcc@example.com \
-s "Hello" \
-t "Plain text content"
To send HTML content, use --html or -H:
unimail-client \
--form "Sender Name" \
--receiver a@example.com \
--subject "Hello" \
--html "<b>Hello</b>"
Attachments
--file accepts one name;path pair per flag. For multiple attachments, repeat --file:
unimail-client \
-r a@example.com \
-s "With attachment" \
-t "Please see attachment" \
--file "report.pdf;./report.pdf"
Multiple attachments should be passed as multiple --file flags:
--file "a.txt;./a.txt" \
--file "b.txt;./b.txt"
Flags
| Flag | Description |
|---|
-k, --key | API key, defaults to UNIMAIL_KEY |
--route | Sets UnimailReq.Route |
-f, --form, --from | Sets UnimailReq.From |
-r, --receiver | Sets UnimailReq.Receivers; repeat multiple times |
-c, --cc | Sets UnimailReq.Cc |
-b, --bb, --bcc | Sets UnimailReq.Bcc |
-s, --subject | Sets UnimailReq.Subject |
-t, --txt | Sets UnimailReq.TxtContent |
-H, --html | Sets UnimailReq.HtmlContent |
--file | Attachment specification in name;path pairs; repeat the flag for multiple attachments |
-v, -V, --version | Show the current version |
-h, --help | Show help text |
Commands
version
Print the current version:
unimail-client version
unimail-client -v
unimail-client -V
unimail-client --version
update / upgrade
update only checks whether a newer Release of unimails/unimail-client is available; it does not install anything:
unimail-client update
upgrade checks the latest Release, downloads the asset matching the current operating system and CPU architecture, and replaces the currently running executable:
unimail-client upgrade
Auto upgrade is only available for direct Release downloads or locally built binaries. Package-manager installations, such as APT/PPA, Winget, or Homebrew builds, disable upgrade and should be upgraded through the same package manager; update remains available for checking releases.
Examples
Send plain text email
unimail-client -r a@example.com -s "Test" -t "Hello"
Send HTML email
unimail-client --receiver a@example.com --subject "Test" --html "<h1>Hello</h1>"
Send email with attachments
unimail-client \
-r a@example.com \
-s "Report" \
-t "Please check the attachment" \
--file "report.pdf;./report.pdf"
License
BSD-3-Clause