Skip to content

Commit e123c66

Browse files
committed
fix: fix SMTPFrom not updated in some cases (close QuantumNous#34)
1 parent 9edc82b commit e123c66

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

common/email.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import (
99
)
1010

1111
func SendEmail(subject string, receiver string, content string) error {
12+
if SMTPFrom == "" { // for compatibility
13+
SMTPFrom = SMTPAccount
14+
}
1215
encodedSubject := fmt.Sprintf("=?UTF-8?B?%s?=", base64.StdEncoding.EncodeToString([]byte(subject)))
1316
mail := []byte(fmt.Sprintf("To: %s\r\n"+
1417
"From: %s<%s>\r\n"+

model/option.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ func InitOptionMap() {
6060
common.SysError("Failed to update option map: " + err.Error())
6161
}
6262
}
63-
if common.SMTPFrom == "" { // for compatibility
64-
common.SMTPFrom = common.SMTPAccount
65-
}
6663
}
6764

6865
func UpdateOption(key string, value string) error {

0 commit comments

Comments
 (0)