英文:
How to send email through Gmail API ? Go
问题
我正在尝试使用Go通过Gmail API发送电子邮件,但我发现文档相当有缺陷/令人困惑。首先,我没有看到收件人字段或电子邮件正文。
我不需要上传任何内容,所以我觉得简单上传、多部分上传和可恢复上传方法完全没有用处。是否有任何清晰的示例(包括所需的数据/参数,例如cURL负载)?
另外,我不确定是否只有我一个人这样想,但谷歌API似乎是最糟糕的(在可用性方面),除非有可用的库。Gmail API似乎是一个不错的选择。
英文:
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
得分: 2
你可以直接使用Go语言的GMail API库:http://godoc.org/code.google.com/p/google-api-go-client/gmail/v1
(你甚至可以使用更简单的库,如SlyMarbo/gmail或njern/gogmail)
英文:
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)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论