This commit is contained in:
Yun
2023-12-27 18:16:21 +08:00
commit 0cfc84f57b
2 changed files with 254 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package mailx_test
import (
"fmt"
"statistic/app/pkg/mailx"
"testing"
)
func TestMail(t *testing.T) {
mail := mailx.NewMailx("support@email.blueoceanpay.com", "SupporT2017", "smtpdm-ap-southeast-1.aliyun.com", "80")
msg := mailx.Message{
// Form: "support@email.blueoceanpay.com",
To: []string{"yun@blueoceanpay.com", "995116474@qq.com"},
Cc: []string{"287852692@qq.com"},
Bcc: []string{"1362716835@qq.com"},
Subject: "test mail",
Body: "测试文件",
Attachment: []mailx.Attachment{
// {
// Name: "/code/statistic/out.xlsx",
// ContentType: "",
// WithFile: true,
// },
// {
// Name: "/code/statistic/origin.xlsx",
// ContentType: "",
// WithFile: true,
// },
// {
// Name: "/code/statistic/out2.xlsx",
// ContentType: "",
// WithFile: true,
// },
},
}
err := mail.Send(msg)
fmt.Println(err)
}