This commit is contained in:
Yun
2025-08-30 18:14:09 +08:00
parent 54b1974509
commit 139330aee2
5 changed files with 18 additions and 6 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ type Aliyun struct {
func NewAliyun() *Aliyun {
aliyun := &Aliyun{}
aliyun.Options = interfaces.DefaultOptions()
aliyun.EmailType = "Aliyun"
aliyun.EmailType = interfaces.EmailTypeAliyun
return aliyun
}
+1 -1
View File
@@ -21,7 +21,7 @@ type Aws struct {
func NewAws() *Aws {
aws := &Aws{}
aws.Options = interfaces.DefaultOptions()
aws.EmailType = "Aws"
aws.EmailType = interfaces.EmailTypeAws
return aws
}
+14 -2
View File
@@ -18,10 +18,22 @@ func main() {
panic(err)
}
// 使用em进行后续操作
em.SetOption(ctx, interfaces.SetSmtp(&interfaces.EmailConfigDataSmtp{}))
em,err = em.SetOption(ctx, interfaces.SetSmtp(&interfaces.EmailConfigDataSmtp{
Username: "support@email.blueoceanpay.com",
Password: "SupporT2017",
ReplyTo: "",
Host: "smtpdm-ap-southeast-1.aliyun.com",
Port: "80",
}))
if err != nil {
panic(err)
}
err = em.Send(ctx, interfaces.Message{
Form: "",
Form: "yun@blueoceanpay.com",
To: []string{"995116474@qq.com"},
Subject: "Test Email",
Body: "Hello, this is a test email.",
})
if err != nil {
panic(err)
+1 -1
View File
@@ -18,7 +18,7 @@ type MailGun struct {
func NewMailGun() *MailGun {
mailgun := &MailGun{}
mailgun.Options = interfaces.DefaultOptions()
mailgun.EmailType = "MailGun"
mailgun.EmailType = interfaces.EmailTypeMailgun
return mailgun
}
+1 -1
View File
@@ -29,7 +29,7 @@ type Smtp struct {
func NewSmtp() *Smtp {
smtp := &Smtp{}
smtp.Options = interfaces.DefaultOptions()
smtp.EmailType = "Smtp"
smtp.EmailType = interfaces.EmailTypeSmtp
return smtp
}