Java 脚本在 html 电子邮件模板中不起作用 [英] Java scripts not working in html email template

查看:21
本文介绍了Java 脚本在 html 电子邮件模板中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个场景,我需要使用 c# 发送电子邮件,这可以使用 SMTP 轻松完成,但挑战是将 Web 服务合并到 html 邮件中,因此我在邮件正文中使用了 java 脚本来访问引发按钮单击时的 Web 服务.

作为一个 html(网页),它工作得非常好,但是当我发送邮件并尝试单击邮件中的按钮时,onclick 没有引发 jscript,因此没有发生任何操作,它实际上是 禁用.

我检查了特定html标签中的firebug(在firefox中),令我惊讶的是jscript标签不存在,因此没有引发事件.我的问题是我们可以在 html 电子邮件中访问网络服务吗?JScripts 不能在 Gmail 上工作吗?
html电子邮件是否仅使用href进行重定向...根据我的经验,我从未收到任何使用java脚本的邮件(例如单击按钮会放大同一页面中的图像,这在html,asp中很有可能页).

提前谢谢...

I have a scenario where I need to send an email using c#, which could be easily done using SMTP, but the challenge is to incorporate web service in the html mail, hence i have used java scripts inside mail body to access the web service when a button click is raised.

As a html(Web Page), it works perfectly good but then when i send a mail and try with the click of a button in my mail, the onclick not raised the jscript and hence no action has happened and it was actually disabled.

I checked with the firebug(in firefox) in the particular html tag, to my surprise the jscript tag was not present there hence the event was not raised. My question is can we access web service in html email? and don't JScripts works on Gmails?
Does the html email do only the redirecting, using href... To my experience i have never got any mail which uses java scripts(like click of a button zooms the image in the same page, which is very much possible in html,asp pages).

Thx in advance...

推荐答案

您不能通过电子邮件自动调用 Web 服务.您必须为收件人创建一个 URL 才能打开,并让他们从浏览器中的网页访问 Web 服务.

You can't automatically call a web service from an e-mail letter. You have to create an URL for the recipient to open, and let them access the web service from a web page in the browser.

出于安全原因,任何合理的电子邮件客户端都禁用了 JavaScript 和任何其他第三方通信方法.

JavaScript, and any other third party communication method for that matter, is disabled in any reasonable e-mail client by security reasons.

这篇关于Java 脚本在 html 电子邮件模板中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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