通过javascript打开Outlook [英] opening Outlook through javascript

查看:189
本文介绍了通过javascript打开Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何使用Javascript打开Outlook?

Does anyone know how to open Outlook using Javascript?

我在使用此代码时遇到异常(在IE6中):

I am getting an exception (in IE6) while using this code:

var outlookApp = new ActiveXObject("Outlook.Application");


推荐答案

你绝对可以这样做,代码如下:

You can definitely do this, the code looks like:

var objO = new ActiveXObject('Outlook.Application');     
var objNS = objO.GetNameSpace('MAPI');     
var mItm = objO.CreateItem(0);     
mItm.Display();     
mItm.To = p_recipient;
mItm.Subject = p_subject;
mItm.Body = p_body;     
mItm.GetInspector.WindowState = 2;

p_recipient,p_subject& p_body是变量,传入。

p_recipient, p_subject & p_body being variables, passed in.

您需要确保这在用户信任的网页上运行,否则会导致异常。

也就是说,它需要位于IE的正确区域,并为该区域配置了正确的设置。

You need to ensure this is running on a webpage which users trust, as this will cause exceptions otherwise.
That is it needs to be in the right zone in IE, with the right settings configured for that zone.

这篇关于通过javascript打开Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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