<?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>Send form with certain Data via Email using  code</title><link>https://www.infopathdev.com:443/forums/thread/53956.aspx</link><pubDate>Wed, 21 Apr 2010 10:18:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53956</guid><dc:creator>Eng. Alaa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53956.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53956</wfw:commentRss><description>Hi All,
 
I am new to info path , what I want to do is  like this 


a simple asp.net page that have  these textbooks  :


        Municipality ID, Municipality Name, Municipality Code 

and a Button Called SendMail 

and there is  an info path application Form stored at a certain known place at  my computer, assume it to be  drive c:/

once the user  click the button after entering data in the text boxes  , it must fill out some fields in the form application and they are Municipality Name and Municipality Code then send this form to the municipality via Email  to fill the rest of the application

any ideas , suggestions,

once we have saved the info path as source file, it  generates many files with many extensions 

which one we have to open in the code 
and can we then use the xpath  to pass the data as parameters to the function like this

 private void SetFieldValue(string xPath,string xValue, bool isNil)
       {
           try
           {
             
               XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
 
               XPathNavigator xnMyField = xnDoc.SelectSingleNode(xPath, this.NamespaceManager);
 
 
               if (isNil)
               {
                   if (xnMyField.MoveToAttribute(&amp;quot;nil&amp;quot;, &amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;))
                       xnMyField.DeleteSelf();
               }
              
               xnMyField.SetValue(xValue);
 
               xnDoc = null;
               xnMyField = null;
           }
           catch (Exception ex)
           {
 
               throw new Exception(xPath + &amp;quot;:&amp;quot; + xValue + &amp;quot;:&amp;quot; + ex.StackTrace, ex);
           }</description></item></channel></rss>