feat: update i18n messages and improve error handling

This commit is contained in:
JustSong
2025-02-02 16:25:52 +08:00
parent 5659fde3fb
commit 19998ebb8a
6 changed files with 28 additions and 37 deletions

View File

@@ -5,11 +5,12 @@ import (
"crypto/tls"
"encoding/base64"
"fmt"
"github.com/songquanpeng/one-api/common/config"
"net"
"net/smtp"
"strings"
"time"
"github.com/songquanpeng/one-api/common/config"
)
func shouldAuth() bool {
@@ -98,8 +99,8 @@ func SendEmail(subject string, receiver string, content string) error {
if err != nil {
return err
}
} else {
err = smtp.SendMail(addr, auth, config.SMTPAccount, to, mail)
return nil
}
err = smtp.SendMail(addr, auth, config.SMTPAccount, to, mail)
return err
}