function SendMail(to,body,sub)
{
var theApp ;
var theMailItem ;
var subject = sub;
var msg = body;
var theApp = new ActiveXObject("Outlook.Application")
var theMailItem = theApp.CreateItem(0);
theMailItem.to = to;
theMailItem.Subject = (subject);
theMailItem.Body = (msg);
theMailItem.send();
}
我使用上面的代码从客户端计算机发送mails
,但在此我想添加cc
任何人都可以帮助我,或者是否有任何其他方法从客户端发送mails
帮助表示赞赏。提前致谢
答案 0 :(得分:0)
邮件项目具有CC
属性。只需在发送之前设置它。
theMailItem.CC = "carbon copy recipient goes here";
另外,请记住,属性名称区分大小写。因此,将to
更改为To
,将send
更改为Send
答案 1 :(得分:0)
var theApp = new ActiveXObject("Outlook.Application");
var objNS = theApp.GetNameSpace('MAPI');
var theMailItem = theApp.CreateItem(0);
theMailItem.cc = cc;
theMailItem.to = to;
theMailItem.Subject = (subject);
theMailItem.Body = (msg);
theMailItem.send();
我添加了这一行,var objNS = theApp.GetNameSpace(' MAPI');您现在应该能够找到cc属性。