如何通过Gmail API发送电子邮件?走 [英] How to send email through Gmail API ? Go

查看:178
本文介绍了如何通过Gmail API发送电子邮件?走的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 gmail API 使用 Go ,但我发现文档有很大的缺陷/混乱。一旦我看不到收据栏和电子邮件正文。

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.

我不需要上传任何内容,因此我发现简单上传,Multipart上传,Resumable上传方法完全没用。有没有任何明确的演示(需要数据/参数,例如cURL有效载荷)?

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) ?

作为附注,我不知道我是唯一一个想到这一点的人,但是谷歌apis似乎是最糟糕的(在可用性方面),除非有一个图书馆可用。 Gmail API似乎是一个很好的候选人。

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.

推荐答案

您可以直接使用Go库进行GMail API:

http://godoc.org/code.google.com/p/google- api-go-client / gmail / v1

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

(你有更简单的图书馆,如 SlyMarbo / gmail njern / gogmail

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

这篇关于如何通过Gmail API发送电子邮件?走的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆