<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Sending form data via smtp and Visual Basic .NET</title><link>https://www.infopathdev.com:443/forums/thread/32887.aspx</link><pubDate>Tue, 07 Oct 2008 14:34:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32887</guid><dc:creator>pvinn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32887.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32887</wfw:commentRss><description>&lt;font face="Arial" size="2"&gt;
&lt;p&gt;Thanks for the fast replies !!! &lt;/p&gt;
&lt;p&gt;I was able to steal some of that code and make it do what I wanted&lt;/p&gt;
&lt;p&gt;I&amp;#39;m finding there&amp;#39;s not a lot of VB.NET examples out there, mostly Jscript&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s what I took, &lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;#39;get the value from the text field&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;body &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;AsString&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;= MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Table_1/@Day_of_week&amp;quot;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;, NamespaceManager).Value&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;#39;get the value from the date field&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;dateField &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;AsString&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;= MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:Table_1/@Date&amp;quot;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;, NamespaceManager).Value&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;#39;set the information for the message&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;fromAddress &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailAddress = &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailAddress(&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;healthcheck@test.com&amp;quot;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;toAddress &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailAddress = &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailAddress(&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;pnaccarato@test.com&amp;quot;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;)&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;msgmail &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailMessage = &lt;/font&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;MailMessage(fromAddress, toAddress)&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font face="Courier New" color="#008000" size="2"&gt;&amp;#39;the body has the date variable we created in it, the subject uses the value from our text box -- mind you, this is all made up for a demo, so it isn&amp;#39;t all that interesting&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt;
&lt;p&gt;msgmail.Body = body&lt;/p&gt;
&lt;p&gt;msgmail.Subject = &lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;Health Check for &amp;quot;&lt;/font&gt;&lt;font face="Courier New" size="2"&gt; + dateField + &lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;&amp;quot;. Please review it.&amp;quot;&lt;/p&gt;&lt;/font&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Only 1 problem left, I have to pull about 70 other data fields from my form and place it into the email body with comments before each&lt;/p&gt;
&lt;p&gt;Is there an easy way to do that ?? Or to even send all the data fields at once ? If I can&amp;#39;t send all the data at once, I&amp;#39;ll have to sit there and code 70 fields into my code&lt;/p&gt;
&lt;p&gt;Ex: Body needs to look something like this&lt;/p&gt;
&lt;p&gt;--------------------------------&lt;/p&gt;&amp;quot;Date&amp;quot; - &lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt;data from &amp;lt;/dfs:myFields/dfs:dataFields/d:Table_1/@Date&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" color="#800000" size="2"&gt; 
&lt;p&gt;&amp;quot;Day of Week&amp;quot; - data from &amp;lt;/dfs:myFields/dfs:dataFields/d:Table_1/@Day_of_week&amp;gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;
&lt;p&gt;etc....&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Sending form data via smtp and Visual Basic .NET</title><link>https://www.infopathdev.com:443/forums/thread/32874.aspx</link><pubDate>Tue, 07 Oct 2008 06:25:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32874</guid><dc:creator>sandhyapati</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32874.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32874</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you go through the below links &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/forums/t/2562.aspx"&gt;http://www.infopathdev.com/forums/t/2562.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infopathdev.com/blogs/hilary/archive/2008/08/24/so-you-want-to-send-an-email.aspx"&gt;http://www.infopathdev.com/blogs/hilary/archive/2008/08/24/so-you-want-to-send-an-email.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope they may help you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Sending form data via smtp and Visual Basic .NET</title><link>https://www.infopathdev.com:443/forums/thread/32873.aspx</link><pubDate>Tue, 07 Oct 2008 06:22:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32873</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32873.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32873</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;can you verify this link.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.a1vbcode.com/snippet-3384.asp"&gt;http://www.a1vbcode.com/snippet-3384.asp&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Sending form data via smtp and Visual Basic .NET</title><link>https://www.infopathdev.com:443/forums/thread/32871.aspx</link><pubDate>Tue, 07 Oct 2008 05:43:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:32871</guid><dc:creator>pvinn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/32871.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=32871</wfw:commentRss><description>&lt;p&gt;Hi, having a lot of trouble trying to develop code for VB.NET for what I need to do.&amp;nbsp; I&amp;#39;m a real newbie to .NET but do have a lot of scripting background.&amp;nbsp; I&amp;#39;ve been searching the web and the forums for about a week now, and have only came up with the following.&lt;/p&gt;
&lt;p&gt;I need to send an email via smtp with my infopath form data,&amp;nbsp;in either clear text or an embedded form format, (attachment will be my last resort)&lt;/p&gt;
&lt;p&gt;Data gets&amp;nbsp;sumitted to a SQL DB&lt;/p&gt;
&lt;p&gt;How do I get my data into an snmp email ?&amp;nbsp; Does anyone have any code that will do this ?&lt;/p&gt;
&lt;p&gt;Dim client As New SmtpClient(&amp;quot;server.test.com&amp;quot;)&lt;br /&gt;Dim toAddr As New MailAddress(&lt;a href="mailto:user@test.com"&gt;user@test.com&lt;/a&gt;)&lt;br /&gt;Dim fromAddr As New MailAddress(&amp;quot;&lt;a href="mailto:healthcheck@test.com"&gt;healthcheck@test.com&lt;/a&gt;&amp;quot;)&lt;br /&gt;Dim message As New MailMessage(fromAddr, toAddr)&lt;br /&gt;Message.IsBodyHtml = True&lt;br /&gt;Message.Subject = &amp;quot;This is a Test&amp;quot;&lt;br /&gt;Message.Body = &amp;quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;b&amp;gt;This is an &amp;lt;/b&amp;gt; &amp;lt;font color=red&amp;gt;HTML Message&amp;lt;/font&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt; &amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>