我收到了一封电子邮件:
Dear xxx,
Thank you. You have just ordered the ultimate treat for your taste buds.
Your yummy, lip smacking delight is being prepared with utmost love and attention at your own neighbouring Pizza Hut – Bengaluru - Airport Road....
但是当我说“show original”时,它显示为:
MIME-Version: 1.0
Sender: noreply@pizzahut.co.in
From: noreply@pizzahut.co.in
To: xxx@gmail.com
Reply-To: noreply@pizzahut.co.in
Date: 19 Sep 2014 19:44:26 +0530
Subject: PHD: Your order confirmation
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - server.pizzahut.co.in
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - pizzahut.co.in
X-Get-Message-Sender-Via: server.pizzahut.co.in: authenticated_id: noreply@pizzahut.co.in
PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNp
dGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwx
LXRyYW5zaXRpb25hbC5kdGQiPjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8x
OTk5L3hodG1sIj48aGVhZD48bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNv
bnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCIgLz48dGl0bGU+UGl6emEgaHV0
PC90aXRsZT48L2hlYWQ+PGJvZHk+PHRhYmxlIHdpZHRoPSI2MDAiIGJvcmRlcj0iMCIg
Y2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIj48dHI+PHRkIGFsaWduPSJjZW50
ZXIiIGJnY29sb3I9IiM5NjE3MDAiPjx0YWJsZSB3aWR0aD0iNjAwIiBib3JkZXI9IjAi
IGNlbGxzcGFjaW5nPSIwIiBjZWxscGFkZGluZz0iMCI+PHRyPjx0ZD48aW1nIHNyYz0i
aHR0cDovLzEwLjEyNy4yMDAuMzAvcGhpbmRpYS93ZWIvYXNzZXRzL1BISU4vSW1hZ2Vz
Gmail客户端如何解码此混淆文本中的内容?此外,这是一个特定于Gmail API的qn:这是Gmail API在返回内容时会为我解码的内容吗?
答案 0 :(得分:4)
邮件是base64编码的。在浏览器中按F12打开开发人员工具,然后对消息进行base64解码
atob("PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNp dGlvbmFsLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwx LXRyYW5zaXRpb25hbC5kdGQiPjxodG1sIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8x OTk5L3hodG1sIj48aGVhZD48bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNv bnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCIgLz48dGl0bGU+UGl6emEgaHV0 PC90aXRsZT48L2hlYWQ+PGJvZHk+PHRhYmxlIHdpZHRoPSI2MDAiIGJvcmRlcj0iMCIg Y2VsbHNwYWNpbmc9IjAiIGNlbGxwYWRkaW5nPSIwIj48dHI+PHRkIGFsaWduPSJjZW50 ZXIiIGJnY29sb3I9IiM5NjE3MDAiPjx0YWJsZSB3aWR0aD0iNjAwIiBib3JkZXI9IjAi IGNlbGxzcGFjaW5nPSIwIiBjZWxscGFkZGluZz0iMCI+PHRyPjx0ZD48aW1nIHNyYz0i aHR0cDovLzEwLjEyNy4yMDAuMzAvcGhpbmRpYS93ZWIvYXNzZXRzL1BISU4vSW1hZ2Vz")
这将为您提供原始邮件。
答案 1 :(得分:2)
这是base64编码。任何SMTP(简单邮件传输协议)MIME对象都包含以下格式:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=frontier
This is a message with multiple parts in MIME format.
--frontier
Content-Type: text/plain
This is the body of the message.
--frontier
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
--frontier--
正文(在您的情况下是邮件内容)始终是base64编码的。 如果您想阅读,Wiki链接会更多地与您联系。
http://en.wikipedia.org/wiki/MIME
解码只需使用任何base64解码库(在javascript中)来读取内容。 (
此致