我有一封近4年前的电子邮件,其中包含一个Zip文件作为附件,其中包含可执行的jar文件。我想下载那个文件。但是现在gmail不允许发送或接收任何可执行文件。有人可以帮助我如何从我的电子邮件中下载那个zip文件吗?
我有一封近4年前的电子邮件,其中包含一个Zip文件作为附件,其中包含可执行的jar文件。我想下载那个文件。但是现在gmail不允许发送或接收任何可执行文件。有人可以帮助我如何从我的电子邮件中下载那个zip文件吗?
请自行决定是否继续操作!!!
最简单的解决方案是这个,只需要30秒钟就能完成。只需打开您的网页检查器,并删除Google Drive按钮的"display:none"属性。按钮将随即出现,您就可以在Google Drive中下载您的文件。从您的Google Drive中,您也可以将文件下载到您的电脑上。
干杯
您可以从Android Gmail或Inbox应用程序中下载它。如果您想随时随地访问它,您可以将其放在Drive中。
1. 下载并安装Python 3.4 (https://www.python.org/downloads/release/python-343/)
2. 打开包含被阻止附件的邮件。点击回复
旁边的箭头
按钮并选择显示原始邮件
3. 等待完整页面加载。这可能需要很长时间,具体取决于附件大小和您的网络速度。一旦页面完全加载,保存它。文件名将为0.txt
。将其保存在没有任何其他文本文件的目录中。
4. 打开Python并复制以下代码。将其保存到与0.txt
相同的目录中。通过双击保存的.py
文件运行程序。
# Get your files that Gmail block. Warning message:
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled."
# Based on: http://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/
# Go to your emails, click the arrow button in the top right, "Show original", save to the same directory as this script.
import email
import sys
import os
if __name__ == '__main__':
if len(sys.argv) < 2:
print("Press enter to process all files with .txt extension.")
input()
files = [ f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.txt') ]
else:
files = sys.argv[1:]
print("Files: %s" % ', '.join(files))
print()
for f in files:
msg = email.message_from_file(open(f))
print("Processing %s" % f)
print("Subject: %s" % msg['Subject'])
for pl in msg.get_payload():
fn = pl.get_filename()
if fn:
print("Found %s" % fn)
if os.path.isfile(fn):
print("The file %s already exists! Press enter to overwrite." % fn)
input()
open(fn, 'wb').write(pl.get_payload(decode=True))
print()
你应该能在一段时间后看到你的附件下载到相同的目录中。python <code_file>.py <attach_file>.eml
哇,唯一的解决方案对我有用。 - khue bui如果您是 PHP 程序员,则可以通过邮件菜单选项“显示原始”获取邮件源代码,复制文件附件的 base64 字符串并将其保存到文件中,例如 test.b64,并进行如下操作:
file_put_contents ('test.rar',base64_decode(file_get_contents('test.b64')));
将常规的附件文件保存在test.rar中
如果您正在使用智能手机,只需打开电子邮件,保存附件,将智能手机连接到计算机,通过使用Windows资源管理器在智能手机中打开“下载”文件夹,并将文件复制到桌面即可。
或者,您也可以将此电子邮件从您的智能手机转发到另一个电子邮件地址并从那里下载它。
file.b64
,然后运行base64 --decode -i file.b64 -o file
进行解码。 - Victor Basso