31 lines
564 B
Markdown
31 lines
564 B
Markdown
# Kumoly App
|
|
|
|
combine all needed module into one lib
|
|
|
|
## Run
|
|
|
|
```
|
|
|
|
```
|
|
|
|
## Email
|
|
|
|
```go
|
|
m := gomail.NewMessage()
|
|
m.SetHeader("From", "from@example.com")
|
|
m.SetHeader("To", "to@example.com")
|
|
m.SetHeader("Subject", "Hello!")
|
|
m.SetBody("text/plain", "Hello!")
|
|
|
|
s := gomail.SendFunc(func(from string, to []string, msg io.WriterTo) error {
|
|
// Implements you email-sending function, for example by calling
|
|
// an API, or running postfix, etc.
|
|
fmt.Println("From:", from)
|
|
fmt.Println("To:", to)
|
|
return nil
|
|
})
|
|
|
|
if err := gomail.Send(s, m); err != nil {
|
|
panic(err)
|
|
}
|
|
``` |