I don't have any knowledge in .NET, but fortunately I found a similar problem in Fred Shen's blog (http://fredshen.spaces.live.com/). I mailed him my problem and instantly got an anser and a solution !
Here is the Fred's answer. I tried it and it works! (I marked the changes to be done in the method with red color)
Whenever you initialize the sysmailer class, put InteropPermission.assert() before new SysMailer(). When you look into SysMailer.new() method, you may find that the COM c = new COM(' CDO .Message') is not in the scope of interopPermission.assert(). (I thought it should be a code defect) So alternatively, you can restructure the codes in SysMailer.New() as below:And that's just what I want to achieve with my blog: to get to know people and to help each other. So again: THANX A LOT, FRED !
void new(/* COM c = new COM(' CDO .Message')*/)
InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
c = new COM('CDO .Message');
_COM = c;
//BP Deviation Documented
if (_COM.configuration() == null)