Message=Operation is not valid due to the current state of the object.
Cause:I tried to call SPUtility.SendEmail within the RunWithElevatedPrivileges delegate.
CommentsIf i try to run this method out of Elevated delegate, it works fine. All the other things that are working fine in Elevated Privileges (except send email) are,
Solution:I found two solution/Work arounds ,
- Remove elevation (Do not know why this option works).
- Set HttpContext.Current to null. Following is the detail discussion over why this option works.