We recommend using SendGrid Go, our client library, available on GitHub, with full documentation.
The library does not officially support the V2 API, but you can use V2 with an older version of the library. For more information, see Continue Using V2 in Go.
_19// using SendGrid's Go Library_19// https://github.com/sendgrid/sendgrid-go_19package main_19_19import (_19 "github.com/sendgrid/sendgrid-go"_19)_19_19func main() {_19 sg := sendgrid.NewSendGridClientWithApiKey("SENDGRID_APIKEY")_19_19 message := sendgrid.NewMail()_19 message.AddTo("test@sendgrid.com")_19 message.SetFrom("you@youremail.com")_19 message.SetSubject("Sending with SendGrid is Fun")_19 message.SetHTML("and easy to do anywhere, even with Go")_19_19 sg.Send(message)_19}