<?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: InfoPath code to send an automatic email on Submit</title><link>https://www.infopathdev.com:443/forums/thread/54548.aspx</link><pubDate>Wed, 05 May 2010 16:50:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54548</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54548.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=54548</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;var MailMsg = new MailMessage(); &lt;/em&gt;&lt;/p&gt;</description></item><item><title>InfoPath code to send an automatic email on Submit</title><link>https://www.infopathdev.com:443/forums/thread/54547.aspx</link><pubDate>Wed, 05 May 2010 15:22:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:54547</guid><dc:creator>JFKsr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/54547.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=54547</wfw:commentRss><description>&lt;p&gt;Hello Everyone,&lt;/p&gt;
&lt;p&gt;I am trying to send an automatic email when user completes a form and hits &amp;#39;Submit&amp;#39; button.&lt;/p&gt;
&lt;p&gt;The following is the code I am trying to use in &amp;#39;script.js&amp;#39; file. And, I receive the following error. &lt;/p&gt;
&lt;p&gt;Any ideas on how to fix the issue? Thanks a million in advance!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Error:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;Expected &amp;#39;;&amp;#39;&lt;br /&gt;File:script.js&lt;br /&gt;Line:24&lt;br /&gt;&amp;nbsp;MailMessage MailMsg = new MailMessage();&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Code:&lt;/u&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;function SubmitData::OnClick(eventObj) &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;{ &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MailMessage MailMsg = new MailMessage(); &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MailMsg.Body = &amp;quot;Testing &amp;quot;; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MailMsg.From = &lt;/em&gt;&lt;a href="mailto:share.point@yahoo.com"&gt;&lt;em&gt;share.point@yahoo.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MailMsg.To = &lt;/em&gt;&lt;a href="mailto:xxx@gmail.com"&gt;&lt;em&gt;xxx@gmail.com&lt;/em&gt;&lt;/a&gt;&lt;em&gt;; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;MailMsg.Subject = &amp;quot;InfoPath Test Message&amp;quot;; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;SmtpMail.SmtpServer = &amp;quot;xxx.xxx.xx&amp;quot;; &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;SmtpMail.Send(MailMsg); &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;} &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>