更新
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ type Aliyun struct {
|
|||||||
func NewAliyun() *Aliyun {
|
func NewAliyun() *Aliyun {
|
||||||
aliyun := &Aliyun{}
|
aliyun := &Aliyun{}
|
||||||
aliyun.Options = interfaces.DefaultOptions()
|
aliyun.Options = interfaces.DefaultOptions()
|
||||||
aliyun.EmailType = "Aliyun"
|
aliyun.EmailType = interfaces.EmailTypeAliyun
|
||||||
return aliyun
|
return aliyun
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ type Aws struct {
|
|||||||
func NewAws() *Aws {
|
func NewAws() *Aws {
|
||||||
aws := &Aws{}
|
aws := &Aws{}
|
||||||
aws.Options = interfaces.DefaultOptions()
|
aws.Options = interfaces.DefaultOptions()
|
||||||
aws.EmailType = "Aws"
|
aws.EmailType = interfaces.EmailTypeAws
|
||||||
return aws
|
return aws
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-2
@@ -18,10 +18,22 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
// 使用em进行后续操作
|
// 使用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{
|
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 {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ type MailGun struct {
|
|||||||
func NewMailGun() *MailGun {
|
func NewMailGun() *MailGun {
|
||||||
mailgun := &MailGun{}
|
mailgun := &MailGun{}
|
||||||
mailgun.Options = interfaces.DefaultOptions()
|
mailgun.Options = interfaces.DefaultOptions()
|
||||||
mailgun.EmailType = "MailGun"
|
mailgun.EmailType = interfaces.EmailTypeMailgun
|
||||||
return mailgun
|
return mailgun
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@ type Smtp struct {
|
|||||||
func NewSmtp() *Smtp {
|
func NewSmtp() *Smtp {
|
||||||
smtp := &Smtp{}
|
smtp := &Smtp{}
|
||||||
smtp.Options = interfaces.DefaultOptions()
|
smtp.Options = interfaces.DefaultOptions()
|
||||||
smtp.EmailType = "Smtp"
|
smtp.EmailType = interfaces.EmailTypeSmtp
|
||||||
return smtp
|
return smtp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user