feat: psap support ticket notification

This commit is contained in:
zhangsz
2025-06-20 18:43:08 +08:00
parent 73ba248237
commit 9d1e2d6171
15 changed files with 147 additions and 10 deletions

19
lib/email/email.go Normal file
View File

@@ -0,0 +1,19 @@
package email
import "net/smtp"
// 简单邮件发送函数
func SendEmail(to, subject, body string) error {
from := "your@email.com"
password := "your_password"
smtpHost := "smtp.yourserver.com"
smtpPort := "587"
msg := "From: " + from + "\n" +
"To: " + to + "\n" +
"Subject: " + subject + "\n\n" +
body
auth := smtp.PlainAuth("", from, password, smtpHost)
return smtp.SendMail(smtpHost+":"+smtpPort, auth, from, []string{to}, []byte(msg))
}