L
letoat
I'm using the following code to access my outlook client from a web
application (ASP.NET)
function send (recipient, subject, msg, attach){
var theApp = new ActiveXObject("Outlook.Application");
var oNS = theApp.GetNameSpace("MAPI");
//oNS.Logon(oNS.CurrentUser.Name, "MyPass", true, false);
oNS.Logon("MyName", "MyPass", true, false);
var oALs = oNS.AddressLists;
var oAL = oALs.Item("Contacts");
var oEntries = oAL.AddressEntries;
var oEntry;
var text = "";
for(var j = 1; j <= oEntries.Count; j++){
text += oEntries.Item(j).Name() + ";";
}
alert(text);
var theMailItem = theApp.CreateItem(0);
theMailItem.BCC = "(e-mail address removed)";
for(var i=0; i<20; i++){
theMailItem.BCC += ";toto" + i + "@example.com";
}
theMailItem.Subject = (subject);
theMailItem.Body = (msg);
theMailItem.Attachments.Add(attach,1);
theMailItem.display(true);
theMailItem.Recipients.ResolveAll();
//theMailItem.Send;
oNS.Logoff();
}
My problem comes from the fact there is an outlook security popup
which is open when i execute this code. Somebody know how to remove
this alert ?
The popup contains about this message : "Allow access during : " ...
I've tried to add my AD profile into outlook profile access but that
doesn't work. (this is in : properties --> security)
Thanks for help.
If somebody try other way to access from an asp.Net application to
outlook (for example using OWA or other...) I will be very interested
:
In fact I want to use "mailto" protocol but the length of the bcc
input is to long to use this protocol (>2048). I know that i can use
SMTPMail but i want to access to personnal contact and i can't do that
with SMTP. This is why i try to access to outlook programmatically to
be able to access my personnal contacts.
application (ASP.NET)
function send (recipient, subject, msg, attach){
var theApp = new ActiveXObject("Outlook.Application");
var oNS = theApp.GetNameSpace("MAPI");
//oNS.Logon(oNS.CurrentUser.Name, "MyPass", true, false);
oNS.Logon("MyName", "MyPass", true, false);
var oALs = oNS.AddressLists;
var oAL = oALs.Item("Contacts");
var oEntries = oAL.AddressEntries;
var oEntry;
var text = "";
for(var j = 1; j <= oEntries.Count; j++){
text += oEntries.Item(j).Name() + ";";
}
alert(text);
var theMailItem = theApp.CreateItem(0);
theMailItem.BCC = "(e-mail address removed)";
for(var i=0; i<20; i++){
theMailItem.BCC += ";toto" + i + "@example.com";
}
theMailItem.Subject = (subject);
theMailItem.Body = (msg);
theMailItem.Attachments.Add(attach,1);
theMailItem.display(true);
theMailItem.Recipients.ResolveAll();
//theMailItem.Send;
oNS.Logoff();
}
My problem comes from the fact there is an outlook security popup
which is open when i execute this code. Somebody know how to remove
this alert ?
The popup contains about this message : "Allow access during : " ...
I've tried to add my AD profile into outlook profile access but that
doesn't work. (this is in : properties --> security)
Thanks for help.
If somebody try other way to access from an asp.Net application to
outlook (for example using OWA or other...) I will be very interested
:
In fact I want to use "mailto" protocol but the length of the bcc
input is to long to use this protocol (>2048). I know that i can use
SMTPMail but i want to access to personnal contact and i can't do that
with SMTP. This is why i try to access to outlook programmatically to
be able to access my personnal contacts.