Outlook Security manager 2010, VCL, MapiLogon and MapiSendMail - warnings still pop up

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Security manager 2010, VCL, MapiLogon and MapiSendMail - warnings still pop up
 
Christoph Späth




Posts: 3
Joined: 2010-10-20
Hello,

recently I bought Outlook Security Manager 2010 for a .net application to be able to search user's address book without warnings. That works fine.

Now I'm trying to use it for disabling warnings for a Delphi 2006 VCL application that uses mapi to send mails. Apparently (the application hasn't been developed by me) it uses Simple MAPI (MapiLogon and MapiSendMail) to send the message and I don't want to change that function.

My testing environment is a Windows 7 x64 with 32 bit outlook 2010. As mentioned before, the .net appliction (CPU type x86) works, so the secman.dll was registered correctly.
I tried disabling all smap, oom and cdo warnings, but it didn't help. Your sendmail example doesn't show any warning, independent from its security setting, but it doesn't seem to use MAPI.

Here is my delphi code:


...
CoInitialize(nil);
OLSecMan := TOlSecurityManager.Create(nil);
// for secman I need the outlook application. however, neither outlook2000 nor outlook_xp seem to work
Outlook := TOutlookApplication.Create(nil);
OLSecMan.ConnectTo(Outlook.Application);
try
  OLSecMan.DisableSMAPIWarnings := true;
  OLSecMan.DisableCDOWarnings := true;
  OLSecMan.DisableOOMWarnings := true;
  rc := DoSendMAPI( ... ); // function that calls MapiLogon, MapiSendMail and MapiLogoff
finally
  OLSecMan.DisableSMAPIWarnings := false;
  OLSecMan.DisableCDOWarnings := false;
  OLSecMan.DisableOOMWarnings := false;
  Outlook.Free;
  FreeAndNil(OlSecMan);
  CoUninitialize();
end;
...


Is there any error or is Outlook Security Manager not suitable for my scenario?

Thanks in advance.
Posted 20 Oct, 2010 10:41:23 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hi Christoph,

A raw skectch:

OLSecMan := TOlSecurityManager.Create(nil); 
try 
  OLSecMan.DisableSMAPIWarnings := true;
  rc := DoSendMAPI( ... ); // function that calls MapiLogon, MapiSendMail and MapiLogoff 
finally 
  OLSecMan.DisableSMAPIWarnings := false; 
end; 


Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 20 Oct, 2010 11:32:55 Top
Christoph Späth




Posts: 3
Joined: 2010-10-20
Hi Andrei,

thanks for the fast answer.
I tried this approach before, but that raises an exception with message "Outlook Security Manager is not found."
I have tried putting secman.dll next to the application, system32/sysWOW64 (and registering there) but it didn't help.

Thanks,
Chris
Posted 20 Oct, 2010 11:50:08 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hi Christoph,

I'm sorry, are you saying that your variant of the same code doesn't produce "Outlook Security Manager is not found."?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Oct, 2010 08:50:03 Top
Christoph Späth




Posts: 3
Joined: 2010-10-20
Hi Andrei,

Yes, I was saying that.
In my variant I called CoInitialize, what I didn't in my first approach / your variant.

Now it seems to work.
Thank you!

Regards,
Chris
Posted 26 Oct, 2010 10:28:19 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hi Chris,

Thank you for letting me know.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 27 Oct, 2010 11:38:37 Top