MIME电子邮件不工作(GMail的API)的Base64编码解码 [英] Base64 decoding of MIME email not working (GMail API)

查看:242
本文介绍了MIME电子邮件不工作(GMail的API)的Base64编码解码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Gmail的API来检索电子邮件的内容。我正在以下的base64 EN codeD数据为身体: http://hastebin.com/ovucoranam.md

I'm using the GMail API to retrieve an email contents. I am getting the following base64 encoded data for the body: http://hastebin.com/ovucoranam.md

但是当我通过一个base64德codeR运行它,它要么返回一个空字符串(错误)或一些类似的HTML数据,但和一帮奇怪的字符。

But when I run it through a base64 decoder, it either returns an empty string (error) or something that resembles the HTML data but with a bunch of weird characters.

帮助?

推荐答案

我不知道你是否已经解决了它,但GmailGuy是正确的。您需要将身体转换为Base64编码RFC 4648标准。该JIST是你需要替换 - + _ /

I'm not sure if you've solved it yet, but GmailGuy is correct. You need to convert the body to the Base64 RFC 4648 standard. The jist is you'll need to replace - with + and _ with /.

我已经采取了原来的输入,也做了更换: http://hastebin.com/ukanavudaz

I've taken your original input and did the replacement: http://hastebin.com/ukanavudaz

和使用base64de code.org脱code它,这是罚款。

And used base64decode.org to decode it, and it was fine.

这篇关于MIME电子邮件不工作(GMail的API)的Base64编码解码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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