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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}