I have been trying to use the code written in the earlier part of this thread. Following is my code which yields the error message below as well.
function XDocument::OnSubmitRequest(eventObj)
{
If the submit operation is successful, set eventObj.ReturnStatus = true;
MailMessage msgmail = new MailMessage();
msgmail.Body = ...