调整接口
This commit is contained in:
+8
-13
@@ -9,24 +9,19 @@ import (
|
||||
|
||||
"code.yun.ink/pkg/mailx/interfaces"
|
||||
"code.yun.ink/pkg/mailx/smtp"
|
||||
"github.com/yuninks/loggerx"
|
||||
)
|
||||
|
||||
func TestMail(t *testing.T) {
|
||||
sm := smtp.Smtp{}
|
||||
sm := smtp.NewSmtp()
|
||||
ctx := context.Background()
|
||||
|
||||
logger := loggerx.NewLogger(ctx)
|
||||
|
||||
ini, err := sm.InitEmail(ctx, interfaces.EmailConfigData{
|
||||
Smtp: &interfaces.EmailConfigDataSmtp{
|
||||
Username: "test@email.aisz.org",
|
||||
Password: "FDuSoJKiC9tNSDIG6DFh",
|
||||
ReplyTo: "",
|
||||
Host: "smtpdm.aliyun.com",
|
||||
Port: "80",
|
||||
},
|
||||
}, logger)
|
||||
ini, err := sm.SetOption(ctx, interfaces.SetSmtp(&interfaces.EmailConfigDataSmtp{
|
||||
Username: "test@email.aisz.org",
|
||||
Password: "FDuSoJKiC9tNSDIG6DFh",
|
||||
ReplyTo: "",
|
||||
Host: "smtpdm.aliyun.com",
|
||||
Port: "80",
|
||||
}))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user