<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>[How Do I:] Create a Reusable Component for Sending Email to a Distribution List</title><link>http://asp.net</link><pubDate>Fri, 10 Jun 2011 06:33:46 GMT</pubDate><generator>umbraco</generator><description>Comments for [How Do I:] Create a Reusable Component for Sending Email to a Distribution List</description><language>en</language><atom:link href="http://asp.net/rss/comments/33518" rel="self" type="application/rss+xml" /><item><title>Comment Posted by rami_nassar</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Thu, 04 Dec 2008 20:05:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006186</guid><description><![CDATA[ <p>Good job Chris Pels</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/rami_nassar.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jasbits</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 05 Dec 2008 00:58:07 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006188</guid><description><![CDATA[ <p>Thanks for a great tutorial Chris. </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/jasbits.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by yousaid</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 05 Dec 2008 09:34:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006189</guid><description><![CDATA[ <p>Chris, YOU ROCK.</p> <p>I was about to start woring on similar stuff for my CMS.</p> <p>THANKS a bunch !!</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/yousaid.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by javabeans</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 05 Dec 2008 12:53:35 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006190</guid><description><![CDATA[ <p>Chris, i must really commend your tutorials. I have benefitted intensely from them. I have been following your series on emailing in .netand i like the way you carefully explain. God bless you and I would appreciate a tutorial also on Instant messenging and chatting. Thanks a lot</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/javabeans.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ramy ramadan</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Sat, 06 Dec 2008 06:58:08 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006191</guid><description><![CDATA[ <p>Thanks Chris Pels</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ramy%20ramadan.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ronto1956</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Wed, 10 Dec 2008 10:16:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006192</guid><description><![CDATA[ <p>chris you&#39;re the man..</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ronto1956.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by faremax</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Sat, 13 Dec 2008 14:46:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006193</guid><description><![CDATA[ <p>I am getting &quot;System.InvalidOperationException: An asynchronous call is already in progress. It must be completed or canceled before you can call this method.&quot; error. Did anybody else experience the same error?</p> <p>Also, shouldn&#39;t SendMessage(mailMessage) call be outside of the For loop. &#160;When I move it out I get no error message but email is only being sent to the last person in the table probably because of the mailMessage.To.Clear. When I remove To.Clear and move SendMessage(mailMessage) out it works but I get a list of addresses in the To field and I really don&#39;t want people on the dist list to see that. Is there a way to hide that list? &#160;I want people to only see their own email address in the To field.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/faremax.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by bill32</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Tue, 23 Dec 2008 12:55:01 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006194</guid><description><![CDATA[ <p>I get the same exception, and am pretty sure this code is flawed. &#160;Since the demo code swallows exceptions, he&#39;s not seeing it, but MS doesn&#39;t let you use SendAsync this way.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/bill32.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jwhanes</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Wed, 11 Feb 2009 00:04:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006195</guid><description><![CDATA[ <p>Yeah, pretty sure this code is bugged. The InvalidOperationException gets thrown when sending multiple emails. &#39;An asynchronous call is already in progress. It must be completed or canceled before you can call this method.&#39; How can this be fixed? </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/jwhanes.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by bohunt</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 13 Feb 2009 17:43:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006196</guid><description><![CDATA[ <p>Thanks..</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/bohunt.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Dunfalach</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Thu, 26 Feb 2009 14:07:14 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006197</guid><description><![CDATA[ <p>I&#39;ve just been researching this same thing (which is how I ended up here). According to the MSDN page <a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/x5x13z6h(VS.80).aspx" target="_blank">msdn.microsoft.com/</a> trying to use SendAsync as a way of rapidly cycling through multiple emails doesn&#39;t appear to be what they had in mind: &amp;quot;After calling SendAsync, you must wait for the e-mail transmission to complete before attempting to send another e-mail message using Send or SendAsync.&amp;quot;</p><p></p><p>Basically, it looks like SendAsync is meant to allow you to send a single email and process code that comes after it, rather than to allow you to send the next without waiting for the first to complete. I did see one forum that said that if you created a new instance of smtpclient for each email, you could process faster. I can&#39;t currently confirm whether this works, however.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Dunfalach.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by uwspstar</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 27 Feb 2009 17:39:02 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006198</guid><description><![CDATA[ <p>excellent job</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/uwspstar.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by poseidonredsea</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 06 Mar 2009 10:55:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006200</guid><description><![CDATA[ <p>Hello </p><p>Thanks for this great article .  I followed the steps but I get an exception says :</p><p>ex = {&quot;An asynchronous call is already in progress. It must be completed or canceled before you can call this method.&quot;}</p><p></p><p>I don&#39;t know why this happen . can someone help me with it </p><p>Regards</p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/poseidonredsea.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by flybentley</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Thu, 19 Mar 2009 14:18:02 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006201</guid><description><![CDATA[ <p>Hi Chris Pels and everyone,</p><p></p><p>This code is good for a sample, but will never work in practice.</p><p>1) Because in the loop you are sending emails asynchronously. That is when you get to the next reciepient in the loop, you are not done with the previous. The prevois email is being sent and being used. That is why you cannot just clear the To property.</p><p>2) You cannot return the sentEmails property with a correct number of sent emails, because when you exit the method the emails are still being sent and the OnSendCompleted Eventhandler will continue to fire long after you have left the method.</p><p></p><p>I could propose, Chris, you fixed the issues and come out with a new video, if this is possible. Because there is a lot of wrong in this video, that will confuse the folks out there trying to get started with such an application.</p><p></p><p>Regards</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/flybentley.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ADPrevost</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Thu, 02 Jul 2009 15:30:56 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006202</guid><description><![CDATA[ <p>I agree with flybentley.  I wasted a lot of time. Next time I&#39;ll read the posts first. </p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/ADPrevost.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by abo_malik</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Mon, 26 Jul 2010 15:12:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000009628</guid><description><![CDATA[ <p>good video</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/abo_malik.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mehta.rahulit</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 10 Jun 2011 06:32:26 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013475</guid><description><![CDATA[ <p>nice one!!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mehta.rahulit.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mehta.rahulit</title><link>http://asp.net/web-forms/videos/how-do-i/how-do-i-create-a-reusable-component-for-sending-email-to-a-distribution-list</link><pubDate>Fri, 10 Jun 2011 06:33:46 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000013476</guid><description><![CDATA[ <p>i just read flybentley comment about!! is that true??</p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/mehta.rahulit.jpg?forceidenticon=false&amp;dt=635045304600000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>