https://github.com/etkecc/go-trysmtp
https://github.com/etkecc/go-trysmtp
library smtp
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/etkecc/go-trysmtp
- Owner: etkecc
- License: lgpl-3.0
- Created: 2024-08-08T19:04:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-14T16:37:53.000Z (about 1 year ago)
- Last Synced: 2025-01-23T13:13:59.166Z (11 months ago)
- Topics: library, smtp
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# trySMTP
Library that tries to connect to SMTP host by TO/target email address:
* Lookup MX and A
* Try to connect to SMTP on different ports
* Try to use STARTTLS if server supports it
* Return SMTP Client with `Mail()` and `Rcpt()` already called
```go
from := "sender@example.com"
to := "target@example.org"
client, err := trysmtp.Connect(from, to)
if err != nil {
// something went wrong!
}
client.Data([]byte("your email data here"))
```