<img src="https://github.com/KeepSec-Technologies/Mail2Go/assets/108779415/afb750ff-0320-46d5-8e03-e26dfbde1c49"
Mail2Go is a very lightweight command-line SMTP client written in Go, designed to send emails from the command-line easily.
~/.config/mail2go/config.json).Download the Linux amd64 binary with wget (more versions on release tab):
shell
wget https://github.com/KeepSec-Technologies/Mail2Go/releases/download/1.1.8/mail2go_linux_amd64_1.1.8.tar.gz
Unpack it with tar
shell
tar -xf mail2go_linux_amd64_1.1.8.tar.gz
Move it to your /usr/local/bin/ (Optional):
shell
sudo mv mail2go /usr/local/bin/mail2go
Clone the repository:
shell
git clone https://github.com/KeepSec-Technologies/Mail2Go
Navigate to the cloned directory:
shell
cd Mail2Go
Build the tool:
shell
CGO_ENABLED=0 go build -a -installsuffix cgo -o mail2go .
Run the Mail2Go tool with the required arguments:
-s, --smtp-server SMTP server for sending emails
-p, --smtp-port SMTP server port (Default: 587)
-u, --smtp-username Username for SMTP authentication
-w, --smtp-password Password for SMTP authentication
-na, --no-auth No authentication required
-l, --tls-mode TLS mode (none, tls-skip, tls)
-f, --from-email Email address to send from
-c, --config Path to the SMTP json config file which replaces the above arguments
-t, --to-email Email addresses that will receive the email, comma-separated
-r, --reply-to Email address to reply to (optional)
-h, --subject Subject of the email
-b, --body Body of the email
-af, --attachments File paths for attachments, comma-separated (optional)
-bf, --body-file File path for HTML email body (replaces the --body argument)
-v, --version Application version
# Basic example:
mail2go -s mail.example.com -p 587 -u user@example.com -w password123 -l tls -f mail2go@example.com -t admin@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
# Example with two recipients, the body from an HTML file and two attached files (can be more):
mail2go -s mail.example.com -p 587 -u user@example.com -w password123 -l tls -f mail2go@example.com -t admin@example.com,other@example.com -h 'Test Mail2Go Subject' -bf demo/body.html -af README.md,demo/mail2go-smaller.png
# Example with a reply-to address:
mail2go -s mail.example.com -p 587 -u user@example.com -w password123 -l tls -f mail2go@example.com -t admin@example.com -r replytome@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
# Example without authentication and no TLS:
mail2go -s mail.example.com -p 25 -l none -f mail2go@example.com -t admin@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
# Example of a local SMTP server with a TLS certificate that can't be verified:
mail2go -s localhost -p 587 -u user@example.com -w password123 -l tls-skip -f mail2go@example.com -t admin@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
Example of json configuration file to pass to Mail2Go:
{
"smtp_server": "mail.example.com",
"smtp_port": 587,
"smtp_username": "user@example.com",
"smtp_password": "password_example",
"no_auth": false,
"tls_mode": "tls",
"from_email": "mail2go@example.com"
}
Example of the command that goes with it:
mail2go -c demo/config.json -t admin@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
If you are using the default configuration file at ~/.config/mail2go/config.json it would look like this:
mail2go -t admin@example.com -h 'Test Mail2Go Subject' -b 'This is a body!'
Note: CLI arguments will override configuration files (from the --config argument or the default location at ~/.config/mail2go/config.json).
Contributions to Mail2Go are welcome. Please fork the repository and submit a pull request with your changes or improvements.
This project is licensed under MIT - see the LICENSE file for details.
$ claude mcp add Mail2Go \
-- python -m otcore.mcp_server <graph>