Categorygithub.com/Armatorix/yasmtp
repositorypackage
0.0.0-20231022184309-7257645f8e7d
Repository: https://github.com/armatorix/yasmtp.git
Documentation: pkg.go.dev

# README

Yet Another SMTP client

Created for simplare SMTP client usage, as most of the time you simply want to send email from your gmail account.

Additionally it handles context - which does not come by default from net/smtp.

Example

package main

func main() {
	ctx := context.Background()
	err := SendHTML(ctx, &Input{
		From: From{
			Email:          "[email protected]",
			Password:       "your_gmail_acc_password",
			ServerHostPort: "smtp.gmail.com:587",
		},
		To: []To{{
			Email: "[email protected]",
		}},
		Msg: Message{
			Subject: "Your email subject",
			Body:    "Some email body",
		},
	})
    if err != nil {
        panic(err)
    }
}

aaaand that's it.

Links

TODO:

[] option for local testing [] handling non-html