Maybe someone knows how to send a message from the code to Go?
1 answer
Like that
package main import ( "log" "smtp" ) func main() { auth := smtp.PlainAuth("", "some@ya.ru", "password", "smtp.yandex.ru") err := smtp.SendMail("smtp.yandex.ru:25", auth, "from@ya.ru", []string{"to@ya.ru"}, []byte("Текст письма.")) if err != nil { log.Fatal(err) } } More examples here: SendingMail .
|