tags:

views:

283

answers:

1
+1  Q: 

interop.cdo.dll

hi,

If user is in Administrative group then interop.cdo.dll is sending mail. But if user is not in administrative group then it is not sending mail.Can any one help me how can i provide permission for interop.cdo.dll for user having non administrative group.

i am using VS 2003.

thanks

+1  A: 

Go to where interop.cdo.dll is located and right-click on it: Properties > Security Tab:

  • Click Edit
  • Click Add
  • Click Advanced
  • Click Find Now

Scroll down in the list and find the user that looks similiar to IUSR_<ServerName> and add it. This is your standard IIS level account. This is also assuming that you're using ASP.NET to access the interop.cdo.dll.

If it's anything else, you can follow the same steps and just use Everyone to test and see if it works. Hope it helps!

*Edit: I found this example here (adapted for c#), that might solve your problem:

CDOInteropThingy.Mailobject objCDOMail = new CDOInteropThingy.MailObject();

objCDOMail.Subject = "Sending email with CDO";
objCDOMail.From = "[email protected]";
objCDOMail.To = "[email protected]";
objCDOMail.TextBody = "This is a message.";

objCDOMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

//Name or IP of remote SMTP server
objCDOMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.server.com"

//Server port
objCDOMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 

objCDOMail.Configuration.Fields.Update();
objCDOMail.Send();
Mr. Smith
I think wont work.Actual scenario is like if i log in using administrative right my Send/mail function works properly.When i log in using service account, it does not send mail and following error occurs"System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid"
Does your INTEROP work from some sort of configuration file (ini) or something like that? Perhaps it's hard coded to only allow Administrator-level users? Did you write the Interop yourself or is it a third-party component?
Mr. Smith
There is no configuration file for interop.This component actually comes with windows OS. for your reference i am attaching the error:The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid. Stack Trace: [COMException (0x80040220): The "SendUsing" configuration value is invalid.]
Updated my answer, see if that works for you.
Mr. Smith
I appreciate your effort Boekwurm, Thank you for your reply.If you could tell me how can i give permission to user so that he/she can send mail without change in any code.Because If i log in with administrative account the code works perfectly fine.If i log in with non administrative account it gives error "Could not access 'CDO.Message' object......" !
I'm sorry, but I'm out of ideas. It's specifically complaining about the SendUsing configuration value, which I already addressed. Have you tried registering the actual DLL? (CDOSYS.dll)?
Mr. Smith
yes i have tried. but it didn't help.I followed all the steps from http://support.microsoft.com/kb/895552 . I also added SMTP permission to secvice account.It didn't work at all.