mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 10:33:41 +08:00
feat: update i18n messages and improve error handling
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user