I created a very simply infopath form with I submit "to email". A wizard, in the infopath client, takes me through the steps on submitting the template as an email. The recipient gets the form as part of the email body. Great! Now I need to do the same thing using asp.net
I did a lot of research and have not found much.
-
How do I open an infopath template in managed code, c#, asp.net?
-
I added references to the Microsoft.Office.Infopath namespace. Now, I have access to the OM, but I have no clue how to deal with the file/template.
-
I found code which demonstrates how to submt the form using VSTO.
var objEmailAdapter;
var varTo = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:To");
var varCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:CC");
var varBCC = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:BCC");
var varIntro = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Intro");
var varSubject = XDocument.DOM.selectSingleNode("/my:myFields/my:EmailInfo/my:Subject");
objEmailAdapter = XDocument.DataAdapters("Email Adapter Name");
objEmailAdapter.To = varTo.text;
objEmailAdapter.CC = varCC.text;
objEmailAdapter.BCC = varBCC.text;
objEmailAdapter.Intro = varIntro.text;
objEmailAdapter.Subject = varSubject.text;
objEmailAdapter.Submit();
All what I need to find out is how to do this in C# and asp.net. Any help is appreciated