Microsoft Outlook签名中的JavaScript

时间:2016-06-06 11:47:02

标签: javascript outlook

我正在尝试在Outlook 2013中使用javascript运行html签名。在浏览器中它可以工作,但是当我在Microsoft Outlook中打开它时它会给我空邮件。所以我的问题是:是否有可能在Outlook中运行js? 带有示例图像的代码如下所示

<!DOCTYPE html>
<html>
<head>
<title>Signature</title>
</head>
<body>

<script>
    var img = new Image();
    var firstPartOfLink = 'http://www.devinrolsen.com/google-maps-marker-icon-counter/marker-maker.php?fontType=ARIAL&fontSize=23&x=16&y=65&r=0&color=255,255,255&image=custom-pin.png&text=Example?';

    var now = new Date();
    var start = new Date(now.getFullYear(), 0, 0);
    var diff = now - start;
    var oneDay = 1000 * 60 * 60 * 24;
    var day = Math.floor(diff / oneDay);
    var stamp = 'stamp=' + day;
    var queryString = firstPartOfLink + stamp;
    
    img.src = queryString;
    
    document.body.appendChild(img);
</script>

</body>
</html>

1 个答案:

答案 0 :(得分:1)

电子邮件不能/不应包含javascript,因为

  1. 安全原因(想象垃圾邮件可以用脚本做什么)
  2. 并非所有(桌面)电子邮件客户端都包含或支持javascript
  3. 请参阅TouchImageView