How to send email through Gmail API ? Go

huangapple go评论90阅读模式
英文:

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/gmailnjern/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)

huangapple
  • 本文由 发表于 2014年8月18日 20:27:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/25363312.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定