-1
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();  

}

I'm using above code to send mails from the client machine, but in this i would like to add cc could anyone kindly help me on this or if there is any other methods to send mails from client side help is appreciated. Thanks in advance

Akash Amin
  • 2,741
  • 19
  • 38
Vickyster
  • 163
  • 3
  • 5
  • 18

2 Answers2

0

The mail item has a CC property. Just set it before send.

theMailItem.CC = "carbon copy recipient goes here";

Also, have in mind that the property names are case sensitive. So change to to To and send to Send

Bozhidar Stoyneff
  • 3,576
  • 1
  • 18
  • 28
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();

I have added this line, var objNS = theApp.GetNameSpace('MAPI'); You should now be able to find the cc attribute.

January Mmako
  • 320
  • 1
  • 7