postmoogle/vendor/github.com/etkecc/go-trysmtp
2024-10-14 19:47:05 +03:00
..
client.go update deps; restructure 2024-10-14 19:47:05 +03:00
justfile migrate to github 2024-08-20 22:56:56 +03:00
LICENSE migrate to github 2024-08-20 22:56:56 +03:00
README.md migrate to github 2024-08-20 22:56:56 +03:00

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
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"))