https://github.com/txthinking/mailx
A lightweight SMTP mail library
https://github.com/txthinking/mailx
email go mail smtp
Last synced: about 1 year ago
JSON representation
A lightweight SMTP mail library
- Host: GitHub
- URL: https://github.com/txthinking/mailx
- Owner: txthinking
- License: mit
- Created: 2016-01-08T14:09:29.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-03-25T13:06:22.000Z (about 3 years ago)
- Last Synced: 2025-03-19T05:55:28.636Z (about 1 year ago)
- Topics: email, go, mail, smtp
- Language: Go
- Homepage: https://www.txthinking.com
- Size: 36.1 KB
- Stars: 29
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## mailx
[](https://goreportcard.com/report/github.com/txthinking/mailx)
[](https://godoc.org/github.com/txthinking/mailx)
A lightweight SMTP mail library
❤️ A project by [txthinking.com](https://www.txthinking.com)
### Install
```
$ go get github.com/txthinking/mailx
```
### Example
```
server := &mailx.SMTP{
Server: "smtp.mailtrap.io",
Port: 465,
UserName: "e3f534cfe656f4",
Password: "b6e38ddc0f1e9d",
}
message := &mailx.Message{
From: &mail.Address{
Name: "mailx",
Address: "739f35c64d-48cf45@inbox.mailtrap.io",
},
To: []*mail.Address{
{
Name: "Cloud",
Address: "cloud@txthinking.com",
},
},
Subject: "Hello",
Body: "I love U.",
Attachment: []string{
"/etc/hosts",
},
}
if err := server.Send(message); err != nil {
log.Fatal(err)
}
```
## License
Licensed under The MIT License