package tools import ( "fmt" "log" "testing" ) func TestSendSmtp(t *testing.T) { for i := 0; i < 1; i++ { body := fmt.Sprintf("

hello,body %d

", i) subject := fmt.Sprintf("hello subject %d", i) err := SendSmtp("smtp.qq.com:465", "xxxx@qq.com", "xxxx", []string{"xxxx@qq.com"}, subject, body) log.Println(err) } }