aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-10-27 00:42:27 +0800
committerGitHub <noreply@github.com>2020-10-26 12:42:27 -0400
commit38d11eea58c6618fbab1a83e1637201964100e9a (patch)
tree78d63ac3be1259d2c60943073aeb2340b3834469 /cmd
parentdbebc6b0e3a54b39c92a026be7b9ac270a20ea27 (diff)
downloadgitea-38d11eea58c6618fbab1a83e1637201964100e9a.tar.gz
gitea-38d11eea58c6618fbab1a83e1637201964100e9a.zip
Fix send mail (#13312)
* Fix send mail * Fix send mail * Update modules/private/mail.go Co-authored-by: techknowlogick <matti@mdranta.net>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mailer.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/mailer.go b/cmd/mailer.go
index a9a9048a5e..ee11b56cc7 100644
--- a/cmd/mailer.go
+++ b/cmd/mailer.go
@@ -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
}