I am using go-smtp to attempt to send an email to myself: https://github.com/emersion/go-smtp
auth := sasl.NewPlainClient("", USERNAME, PASSWORD)
to := []string{USERNAME}
msg := strings.NewReader("To: " + USERNAME + "
" +
"Subject: testing golang go-smtp!
" +
"
" +
"This is the email body.
")
err := smtp.SendMail(SERVER_HOST + ":" + SERVER_PORT, auth, USERNAME, to, msg)
if err != nil {
log.Fatal(err)
}
The output is: EOF exit status 1
I am connecting to smtp.gmail.com:465 and can send email through thunderbird okay.
Thanks for your help.
Walter