<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Submit a form to a email data connector in C#?</title><link>https://www.infopathdev.com:443/forums/thread/87935.aspx</link><pubDate>Tue, 12 Mar 2013 13:35:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87935</guid><dc:creator>vinuraj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87935.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=87935</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I am facing the same problem. Could you please tell me solution for the above thread ?&lt;/p&gt;&lt;p&gt;Error    1    The type or namespace name &amp;#39;MailEnvelope&amp;#39; does not exist in the namespace &amp;#39;Microsoft.Office.InfoPath&amp;#39; (are you missing an assembly reference?)&lt;br /&gt;&lt;br /&gt;Error    2    &amp;#39;Microsoft.Office.InfoPath.Application&amp;#39; does not contain a definition for &amp;#39;ActiveWindow&amp;#39;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Raj&lt;/p&gt;</description></item><item><title>Re: Submit a form to a email data connector in C#?</title><link>https://www.infopathdev.com:443/forums/thread/29190.aspx</link><pubDate>Thu, 05 Jun 2008 15:18:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29190</guid><dc:creator>InfoPathN00b</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29190.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=29190</wfw:commentRss><description>&lt;p&gt;I couldn&amp;#39;t find a solution to the The name &amp;#39;thisXDocument&amp;#39; does not exist in the current context error and foudn a different way of doing it using the Mail Envelope class from http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.mailenvelope.aspx but now am getting&lt;br /&gt;&lt;br /&gt;Error&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp; The type or namespace name &amp;#39;MailEnvelope&amp;#39; does not exist in the namespace &amp;#39;Microsoft.Office.InfoPath&amp;#39; (are you missing an assembly reference?)&lt;br /&gt;&lt;br /&gt;Error&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Microsoft.Office.InfoPath.Application&amp;#39; does not contain a definition for &amp;#39;ActiveWindow&amp;#39;&lt;br /&gt;&lt;br /&gt;I have the following usage directives&lt;br /&gt;&lt;br /&gt;using Microsoft.Office.InfoPath;&lt;br /&gt;using System;&lt;br /&gt;using System.DirectoryServices;&lt;br /&gt;using System.Xml;&lt;br /&gt;using System.Xml.XPath;&lt;br /&gt;using System.Net.Mail;&lt;br /&gt;using System.Windows.Forms;&lt;br /&gt;&lt;br /&gt;and I know the references are the same can anyone tell me what I&amp;#39;m missing, I had it working before but changed something (I don&amp;#39;t know what). &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Submit a form to a email data connector in C#?</title><link>https://www.infopathdev.com:443/forums/thread/29163.aspx</link><pubDate>Wed, 04 Jun 2008 14:57:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:29163</guid><dc:creator>InfoPathN00b</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/29163.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=29163</wfw:commentRss><description>&lt;p&gt;I need to submit a form to a email data connector in code (I&amp;#39;m using C# in InfoPath 2007). This article&lt;br /&gt;&lt;br /&gt;How To: Submit Data as an E-mail Message&lt;br /&gt;http://msdn.microsoft.com/en-us/library/bb250998.aspx&lt;br /&gt;&lt;br /&gt;gives an example (in VB) using the EmailAdapter which references the data conenction but I can&amp;#39;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&amp;#39;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.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Update: I&amp;#39;ve found this code:&lt;br /&gt;&lt;br /&gt;EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters[&amp;quot;Submit Email&amp;quot;];&lt;br /&gt;oEmail.To = strTo;&lt;br /&gt;oEmail.CC = sCCAddress;&lt;br /&gt;oEmail.Subject =strSubject;&lt;br /&gt;oEmail.Intro = strMessage;&lt;br /&gt;&lt;br /&gt;oEmail.Submit();&lt;br /&gt;&lt;br /&gt;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 &amp;#39;EmailAdapter&amp;#39; could not be found (are you missing a using directive or an assembly reference?)&lt;br /&gt;and&lt;br /&gt;The name &amp;#39;thisXDocument&amp;#39; does not exist in the current context&lt;br /&gt;Also I need to atatch the form data can I do that using this method? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>