镜像自地址
https://github.com/betterfor/action-send-mail.git
已同步 2026-11-21 00:57:04 +00:00
test
这个提交包含在:
8
main.go
8
main.go
@ -43,7 +43,7 @@ func main() {
|
|||||||
|
|
||||||
m := gomail.NewMessage()
|
m := gomail.NewMessage()
|
||||||
m.SetHeader("Subject", subject)
|
m.SetHeader("Subject", subject)
|
||||||
m.SetHeader("From", getFrom(from, username))
|
m.SetHeader("From", m.FormatAddress(username, from))
|
||||||
m.SetHeader("To", to...)
|
m.SetHeader("To", to...)
|
||||||
m.SetHeader("Cc", cc...)
|
m.SetHeader("Cc", cc...)
|
||||||
m.SetHeader("Bcc", bcc...)
|
m.SetHeader("Bcc", bcc...)
|
||||||
@ -51,6 +51,10 @@ func main() {
|
|||||||
m.SetHeader("In-Reply-To", inReplyTo)
|
m.SetHeader("In-Reply-To", inReplyTo)
|
||||||
m.SetHeader("X-Priority", priority)
|
m.SetHeader("X-Priority", priority)
|
||||||
|
|
||||||
|
fmt.Println("Subject: ", subject)
|
||||||
|
fmt.Println("From: ", m.FormatAddress(username, from))
|
||||||
|
fmt.Println("To: ", to)
|
||||||
|
|
||||||
for _, a := range attachments {
|
for _, a := range attachments {
|
||||||
m.Attach(a)
|
m.Attach(a)
|
||||||
}
|
}
|
||||||
@ -71,6 +75,8 @@ func main() {
|
|||||||
dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
dialer.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println()
|
||||||
|
|
||||||
err := dialer.DialAndSend(m)
|
err := dialer.DialAndSend(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(time.Now(), "send mail error: ", err)
|
fmt.Println(time.Now(), "send mail error: ", err)
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户