https://github.com/alexcoder04/gomail
Send emails via SMTP
https://github.com/alexcoder04/gomail
e-mail email go golang mail side-project smtp smtp-client
Last synced: 9 months ago
JSON representation
Send emails via SMTP
- Host: GitHub
- URL: https://github.com/alexcoder04/gomail
- Owner: alexcoder04
- License: agpl-3.0
- Created: 2021-12-01T16:47:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T20:41:50.000Z (almost 3 years ago)
- Last Synced: 2025-04-03T20:15:42.363Z (11 months ago)
- Topics: e-mail, email, go, golang, mail, side-project, smtp, smtp-client
- Language: Go
- Homepage:
- Size: 58.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gomail
One day my friend asked me if it's possible to automate sending e-mails, so I
decided it's a great opportunity to practice Go and here it is - a tiny program
that can send e-mails via SMTP.
**It was created for educational purposes only, don't use it to spread spam.**
**You need to have an account on a mail server (e. g. Gmail, Outlook or own
server) to use this program!**
## How to install
### Stable release
Download the executable for your operating system from
https://github.com/alexcoder04/gomail/releases/latest.
### Compiling yourself
```sh
git clone https://github.com/alexcoder04/gomail
cd gomail
make linux # or `make windows`
```
## How to use (important!)
The program is configured with the following files:
### `/gomail/settings.yml`
You can use another file by passing the `-s` flag (e. g. `gomail -s mysettings.yml`)
The host address can vary depending on your e-mail provider, most likely it's
something like *mail.example.com* or *smtp.example.com*. The port is also
different for different e-mail providers.
For the username, it is the part of the mail address before the @-sign for my
provider, but it may be the full address (e. g. on Gmail) or something
completely different for your e-mail provider.
```yml
From: youraddress@example.com
Addr: smtp.example.com:587
Host: smtp.example.com
Username: youraddress@example.com
Password: YourSecureP4ssw0rd
Subject: Hello friends!
```
### `/gomail/recipients.txt`
You can use another file by passing the `-r` flag (e. g. `gomail -r friendslist.txt`)
```text
myfriend1@example.com
myfriend2@example.com
```
### `./mail.txt`
You can use another file by passing the `-b` flag (e. g. `gomail -b hello.txt`)
```text
Hello friends,
I sent this mail to you using gomail.
Have a nice day :)
```
## FAQ
### Can I trust you that you aren't going to steal my password?
- Although I never would even try to do something like that, you can't. But
you can read through the code and compile it yourself, so you don't have to
trust anyone :)