feat: psap support ticket notification
This commit is contained in:
19
lib/email/email.go
Normal file
19
lib/email/email.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user