ActiveX - 自动化服务器无法创建对象 [英] ActiveX - Automation Server Can't Create Object

查看:354
本文介绍了ActiveX - 自动化服务器无法创建对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网页,我需要从中发送电子邮件给。我需要从浏览器发送一封大邮件。因为内容大于查询字符串允许的内容,我需要依赖Active X.我想通过Outlook发送此电子邮件。为了做到这一点,我编写了以下代码:

I have a web page from which I need to send an email to. I need to send a LARGE email from the browser. Because the content is larger than the query string allows, I need to rely on Active X. I want to send this email through Outlook. In an attempt to do this, I've written the following code:

try {
  var to = "";
  var cc = "";
  var subject = "Action Required";
  var body = GenerateEmailBody();

  var outlook = new ActiveXObject('Outlook.Application');
  var outlookNamespace = outlook.GetNameSpace('MAPI');

  var message = outlookNamespace.CreateItem(0);
  message.Display();
  message.To = to;
  message.Subject = subject;
  message.Body = body;
  message.GetInspector.WindowState = 2;
} catch (err) {
  alert("Unable to send email. " + err);
}

当我执行此代码时,出现以下错误:

When I execute this code, I get the following error:

ReferenceError: ActiveXObject is not defined 

我做错了什么?

谢谢!

推荐答案

错误自动化服务器无法创建对象表示浏览器的安全设置太低,无法运行ActiveX控件。您必须将您的页面移动到受信任的站点列表并降低ActiveX设置,以便它可以运行。

The error "Automation Server Can't Create Object" means that your browser's security settings are too low for the ActiveX control to run. You have to move your page into the trusted sites list and lower the ActiveX settings so it can run.

我个人会像瘟疫一样避免使用ActiveX,因为它会锁定你进入IE唯一的世界。因此,为什么我们仍然有人坚持使用IE6。

Personally I would avoid ActiveX like the plague since it is locking you into the IE only world. Hence why we still have people stuck with IE6.

您尝试只是预加载邮件,可以使用 mailto:

It you are trying to just preload a mail message, you can use mailto:

这篇关于ActiveX - 自动化服务器无法创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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