I need to submit a form to a email data connector in code (I'm using C# in InfoPath 2007). This article
How To: Submit Data as an E-mail Message
http://msdn.microsoft.com/en-us/library/bb250998.aspx
gives an example (in VB) using the EmailAdapter which references the data conenction but I can't find any C# equivalent (the rest of my code is in C#). I have also found http://www.sharepointblogs.com/ssa/archive/2006/01/03/sending-email-from-infopath-using-managed-code.aspx but I don't want to submit it as a raw SMTP message as it needs to go through Outlook. Can anyone point me in the right direction here, I just need a simple example.
Update: I've found this code:
EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["Submit Email"];
oEmail.To = strTo;
oEmail.CC = sCCAddress;
oEmail.Subject =strSubject;
oEmail.Intro = strMessage;
oEmail.Submit();
here http://www.infopathdev.com/forums/t/1636.aspx?PageIndex=1 which apparently should work in C# but I get an error The type or namespace name 'EmailAdapter' could not be found (are you missing a using directive or an assembly reference?)
and
The name 'thisXDocument' does not exist in the current context
Also I need to atatch the form data can I do that using this method?