How to send email through Gmail API ? Go

2020-06-27 02:07发布

问题:

I'm trying to send email through the gmail API using Go but I find the documentation quite flawed/ confusing. For once I don't see the receipt field nor the email body.

I don't need to upload anything so I find Simple upload, Multipart upload, Resumable upload methods totally useless. Is there any clear demo (with the data /params required e.g. a cURL payload) ?

As a side note I'm not sure if I'm the only one thinking this but the google apis seem quite the worst out there (in terms of usability) unless there is a library available. The Gmail API seems a good candidate.

回答1:

You could use directly the Go library for GMail API:
http://godoc.org/code.google.com/p/google-api-go-client/gmail/v1

(You have even simpler libraries like SlyMarbo/gmail or njern/gogmail)



标签: email go gmail