Registry / messaging / wneessen-go-mail

wneessen-go-mail

JSON →
library0.7.3gogounverified

An easy-to-use Go library for formatting and sending emails.

go get github.com/wneessen/go-mail
INSTALL
IMPORT
SIG · WNEESSEN-GO-MAIL
W
wneessen-go-mail
messaginggov0.7.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mail
github.com/wneessen/go-mail

Creates and sends an email via SMTP.

package main import ( "log" "github.com/wneessen/go-mail" ) func main() { m := mail.NewMsg() if err := m.From("sender@example.com"); err != nil { log.Fatal(err) } if err := m.To("recipient@example.com"); err != nil { log.Fatal(err) } m.Subject("Test") m.SetBodyString(mail.TypeTextPlain, "Hello!") c, err := mail.NewClient("smtp.example.com", mail.WithPort(587), mail.WithSMTPAuth(mail.SMTPAuthPlain), mail.WithUsername("user"), mail.WithPassword("pass")) if err != nil { log.Fatal(err) } if err := c.DialAndSend(m); err != nil { log.Fatal(err) } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.7.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
26
OpenAI (training)
1
Resources
wneessen-go-mail — go get wneessen-go-mail · libregistry