如何使用带有端口587的Amazon SMTP发送电子邮件

I want to send email using Amazon SMTP.

I am using the example

https://gist.github.com/jim3ma/b5c9edeac77ac92157f8f8affa290f45

but is not working !

I got this message error:

tls: first record does not look like a TLS handshake panic: tls: first record does not look like a TLS handshake

Try to use the code from https://golang.org/pkg/net/smtp/#example_SendMail

package main

import (
    "log"
    "net/smtp"
)

func main() {
    // Set up authentication information.
    auth := smtp.PlainAuth("", "user@example.com", "password", "mail.example.com")

    // Connect to the server, authenticate, set the sender and recipient,
    // and send the email all in one step.
    to := []string{"recipient@example.net"}
    msg := []byte("To: recipient@example.net
" +
        "Subject: discount Gophers!
" +
        "
" +
        "This is the email body.
")
    err := smtp.SendMail("mail.example.com:25", auth, "sender@example.org", to, msg)
    if err != nil {
        log.Fatal(err)
    }
}