1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-03 09:07:19 +00:00

Fix send mail (#13312)

* Fix send mail

* Fix send mail

* Update modules/private/mail.go

Co-authored-by: techknowlogick <matti@mdranta.net>
This commit is contained in:
Lunny Xiao
2020-10-27 00:42:27 +08:00
committed by GitHub
parent dbebc6b0e3
commit 38d11eea58
3 changed files with 36 additions and 6 deletions

View File

@ -9,10 +9,13 @@ import (
"net/http"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"github.com/urfave/cli"
)
func runSendMail(c *cli.Context) error {
setting.NewContext()
if err := argsSet(c, "title"); err != nil {
return err
}
@ -38,11 +41,11 @@ func runSendMail(c *cli.Context) error {
status, message := private.SendEmail(subject, body, nil)
if status != http.StatusOK {
fmt.Printf("error: %s", message)
fmt.Printf("error: %s\n", message)
return nil
}
fmt.Printf("Succseded: %s", message)
fmt.Printf("Success: %s\n", message)
return nil
}