Exchange 2007 and 2010 differ in how to configure Impersonation to allow users to send as other users via EWS.
This link is the 2007 way:
This link is the 2010 way:
The user to give impersonation rights to is the user id the application or service is being run with, not the primary mailbox used to connect to the Exchange service.
I was recently needing access to an unimplemented win32 api function call. This can be achieved by using the .NET frameworks PInvoke (Platform Invoke) function. The problem is getting the declarations correct for the particular call. That's where Pinvoke.net comes to the rescue. Find your function, copy and paste, job done.