Explorar el Código

add error for hello func

Gogs hace 10 años
padre
commit
2f1369c614
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      modules/mailer/mailer.go

+ 4 - 1
modules/mailer/mailer.go

@@ -100,7 +100,10 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
 	if err != nil {
 		return err
 	}
-	client.Hello(hostname)
+
+	if err = client.Hello(hostname); err != nil {
+		return err
+	}
 
 	// If not using SMTPS, alway use STARTTLS if available
 	hasStartTLS, _ := client.Extension("STARTTLS")