I tried using smtp.SendMail()go in the program. However, it locks and does not return until the time runs out. This prevents me from knowing what is wrong.
My code is:
to := []string{"recepient@example.com"}
err := smtp.SendMail("smtp.web.de:25", smtp.CRAMMD5Auth("example@web.de", "password"), "example@web.de", to, []byte("hi"))
if err != nil {
fmt.Println(err)
}else{
fmt.Println("Success")
}
After a long time, I get the following error:
dial tcp 213.165.67.124:25: connection timed out
Any ideas what could be the real issue?
source
share