feat: add ForceEmailTLSVerify configuration and improve email sending error handling

closes #50
This commit is contained in:
Laisky.Cai
2025-03-26 10:21:22 +00:00
parent e6d70c8bf7
commit be0f63931f
3 changed files with 57 additions and 26 deletions

View File

@@ -3,13 +3,14 @@ package env
import (
"os"
"strconv"
"strings"
)
func Bool(env string, defaultValue bool) bool {
if env == "" || os.Getenv(env) == "" {
return defaultValue
}
return os.Getenv(env) == "true"
return strings.ToLower(os.Getenv(env)) == "true"
}
func Int(env string, defaultValue int) int {