mirror of
https://github.com/xinliangnote/go-gin-api.git
synced 2024-04-21 12:31:46 +00:00
24 lines
365 B
Go
24 lines
365 B
Go
package mail
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestSend(t *testing.T) {
|
|
options := &Options{
|
|
MailHost: "smtp.163.com",
|
|
MailPort: 465,
|
|
MailUser: "xxx@163.com",
|
|
MailPass: "", //密码或授权码
|
|
MailTo: "",
|
|
Subject: "subject",
|
|
Body: "body",
|
|
}
|
|
err := Send(options)
|
|
if err != nil {
|
|
t.Error("Mail Send error", err)
|
|
return
|
|
}
|
|
t.Log("success")
|
|
}
|