简体   繁体   English

无法将 javascript 文件作为 email 附件发送

[英]Unable to send javascript file as email attachment

Hotmail does not allow javascript files to be attached to emails, what are the reasons behind it?? Hotmail 不允许 javascript 文件附加到电子邮件,这是什么原因?

解决此问题的一种简单方法是使用 .txt 扩展名而不是 .js 扩展名重命名文件。

Email clients do not normally allow emails to be sent with any form of JavaScript because it could be used to install malware on the recipient's computer.电子邮件客户端通常不允许使用任何形式的 JavaScript 发送电子邮件,因为它可用于在收件人的计算机上安装恶意软件。 There was a huge issue with older email clients because they did allow JavaScript.较旧的电子邮件客户端存在一个大问题,因为它们确实允许使用 JavaScript。 As a result anyone using those clients could fall victim to chain mail with malware "strapped on."因此,任何使用这些客户端的人都可能成为“捆绑”恶意软件的连锁邮件的受害者。

Nowadays you can open any email safely without worrying about downloading any viruses.如今,您可以安全地打开任何电子邮件,而无需担心下载任何病毒。 You can, however, still get viruses by clicking on any links within the email that lead to malicious websites;但是,您仍然可以通过单击电子邮件中指向恶意网站的任何链接来感染病毒; so don't click on any email links unless you know they are safe.所以不要点击任何电子邮件链接,除非你知道它们是安全的。

reasoning found in a 2010 blog post:在 2010 年的博客文章中发现的推理:

"Because they're "executable". They are, fundamentally, computer programs or can be treated as computer programs. “因为它们是“可执行的”。从根本上说,它们是计算机程序,或者可以被视为计算机程序。

And as computer programs, they can carry malware."作为计算机程序,它们可以携带恶意软件。”

Hotmail blocks a lot of attachment types, the old work around was to either remove the filename extension on transfer ie (this.js = this) and have the receiver append the extension when they download the file on their end, or compress it in a zip archive. Hotmail 阻止了很多附件类型,旧的解决方法是在传输时删除文件扩展名 ie (this.js = this) 并让接收者在下载文件时附加扩展名,或者将其压缩为压缩存档。

对我来说,唯一有帮助的是将文件重命名为其他名称,例如.jss并要求收件人将其重命名。

如果您有谷歌帐户,您可以压缩顶部文件夹并将其保存在您的谷歌驱动器中,然后共享驱动器链接。

One thing that you can do for static js code is to make one HTML file.您可以为静态 js 代码做的一件事是制作一个 HTML 文件。 Add script tags in it.在其中添加脚本标签。 And write the js code there.并在那里编写js代码。 And upload zip file containing HTML file.并上传包含 HTML 文件的 zip 文件。

You should change.js file to.txt files, then zip it.您应该将.js 文件更改为.txt 文件,然后将其更改为 zip。 It will accept.它会接受。 (Dont change.rar/.zip to.txt. Change.js to.txt) (不要改.rar/.zip转.txt。改.js转.txt)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM