<?xml version="1.0" encoding="UTF-8"?>
<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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>You need hard work to get Lucky!</title>
	<atom:link href="http://zeemalik.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zeemalik.wordpress.com</link>
	<description>They are ill discoverers that think there is no land, when they can see nothing but sea.</description>
	<lastBuildDate>Wed, 18 Feb 2009 20:41:44 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='zeemalik.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/abad046e7bbccd2e4f19f849f9b77068?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>You need hard work to get Lucky!</title>
		<link>http://zeemalik.wordpress.com</link>
	</image>
			<item>
		<title>The SMTP server requires a secure connection or the client was not authenticated</title>
		<link>http://zeemalik.wordpress.com/2009/02/18/the-smtp-server-requires-a-secure-connection-or-the-client-was-not-authenticated/</link>
		<comments>http://zeemalik.wordpress.com/2009/02/18/the-smtp-server-requires-a-secure-connection-or-the-client-was-not-authenticated/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 20:41:44 +0000</pubDate>
		<dc:creator>zeemalik</dc:creator>
				<category><![CDATA[Asp.net]]></category>

		<guid isPermaLink="false">http://zeemalik.wordpress.com/?p=4</guid>
		<description><![CDATA[Problem: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. c25sm1228430ika.11 
 
 
Solution: 
 
 
Public Shared Sub SendEmail()
 
 
    Dim Message As New Net.Mail.MailMessage()
 
    Dim FromEmail As New Net.Mail.MailAddress(&#8220;From Email Address&#8221;)
    Message.From = FromEmail
    Message.To.Add(&#8220;To Email Address&#8221;)
 
 
    Message.Subject = &#8220;Subject of the Email&#8221;
    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeemalik.wordpress.com&blog=2188373&post=4&subd=zeemalik&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h2 style="margin:auto 0;"><span style="font-size:12pt;color:windowtext;font-family:&quot;">Problem</span><span style="font-size:large;color:#800000;font-family:Verdana;">: </span><span class="SubtitleChar"><span style="font-size:12pt;color:windowtext;"><span style="font-family:Cambria;">The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. c25sm1228430ika.11 </span></span></span></h2>
<p class="MsoNormal" style="margin:0;"><span class="value1"><span style="font-size:8pt;color:#333333;font-family:&quot;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Times New Roman;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Times New Roman;"><strong>Solution</strong>: </span></span></p>
<p class="MsoNormal" style="margin:0;"><span class="value1"><span style="font-size:8pt;color:#333333;font-family:&quot;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span class="value1"><span style="font-size:8pt;color:#333333;font-family:&quot;"> </span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:blue;font-family:&quot;">Public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">Shared</span> <span style="color:blue;">Sub</span> SendEmail()</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:blue;">Dim</span> Message <span style="color:blue;">As</span> <span style="color:blue;">New</span> Net.Mail.MailMessage()</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:blue;">Dim</span> FromEmail <span style="color:blue;">As</span> <span style="color:blue;">New</span> Net.Mail.MailAddress(<span style="color:#a31515;">&#8220;From Email Address&#8221;</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>Message.From = FromEmail</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>Message.To.Add(<span style="color:#a31515;">&#8220;To Email Address&#8221;</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>Message.Subject = <span style="color:#a31515;">&#8220;Subject of the Email&#8221;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>Message.Body = <span style="color:#a31515;">&#8220;Body of the Email&#8221;</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8216;Message.SubjectEncoding = System.Text.Encoding.UTF8</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8216;Message.BodyEncoding = System.Text.Encoding.UTF8</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8216;Message.IsBodyHtml = False</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8216;Message.Priority = Net.Mail.MailPriority.High</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:green;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:blue;">Dim</span> SmtpClient <span style="color:blue;">As</span> <span style="color:blue;">New</span> Net.Mail.SmtpClient(<span style="color:#a31515;">&#8220;smtp.YourEmailServer.com&#8221;</span>, PortNo eg: 587 for gmail )</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>SmtpClient.EnableSsl = <span style="color:blue;">True</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8217;smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span><span style="color:green;">&#8217;smtp.UseDefaultCredentials = False</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;color:green;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0 0 0 24pt;"><span style="font-size:10pt;font-family:&quot;">SmtpClient.Credentials = <span style="color:blue;">New</span> Net.NetworkCredential(<span style="color:#a31515;">&#8220;YourEmailAddress&#8221;</span>, <span style="color:#a31515;">&#8220;YourEmailPassword&#8221;</span>)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"><span>    </span>SmtpClient.Send(Message)</span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="text-indent:12pt;margin:0;"><span style="font-size:10pt;color:blue;font-family:&quot;">End</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">Sub</span></span></p>
<p class="MsoNormal" style="text-indent:12pt;margin:0;"><span style="font-size:10pt;color:blue;font-family:&quot;"> </span></p>
<h2 style="margin:auto 0;"><span style="color:#800000;"><span style="font-family:Verdana;"><span>Note:<span style="font-size:large;"> </span></span></span></span><span class="SubtitleChar"><span style="font-size:12pt;color:windowtext;"><span style="font-family:Cambria;">An important point to note is that you have to set the EnableSSl to True before you set the NetWork Credentials of your SMTP client.</span></span></span></h2>
<table border="0" width="100%" align="center">
<tbody>
<tr valign="middle">
<td width="100%" align="left"><a title="Bookmark using any bookmark manager!" href="http://www.addthis.com/bookmark.php" target="_blank"><img src="http://s9.addthis.com/button1-bm.gif" border="0" alt="AddThis Social Bookmark Button" width="125" height="16" /> </a></td>
</tr>
<tr valign="middle">
<td width="100%" align="left"><a href="http://www.linkedin.com/in/zeeshanmalik"><span style="font:80% Arial,sans-serif;color:#0783B6;"><img style="vertical-align:middle;" src="http://www.linkedin.com/img/webpromo/btn_in_20x15.gif" border="0" alt="View zeeshan malik's LinkedIn profile" width="20" height="15" />View zeeshan malik&#8217;s profile</span></a></td>
</tr>
</tbody>
</table>
Posted in Asp.net  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeemalik.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeemalik.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeemalik.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeemalik.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeemalik.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeemalik.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeemalik.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeemalik.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeemalik.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeemalik.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeemalik.wordpress.com&blog=2188373&post=4&subd=zeemalik&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://zeemalik.wordpress.com/2009/02/18/the-smtp-server-requires-a-secure-connection-or-the-client-was-not-authenticated/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ba3c2fe89dcf18cff621c1ead5da5abb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zeemalik</media:title>
		</media:content>

		<media:content url="http://s9.addthis.com/button1-bm.gif" medium="image">
			<media:title type="html">AddThis Social Bookmark Button</media:title>
		</media:content>

		<media:content url="http://www.linkedin.com/img/webpromo/btn_in_20x15.gif" medium="image">
			<media:title type="html">View zeeshan malik's LinkedIn profile</media:title>
		</media:content>
	</item>
		<item>
		<title>How to call client-side Javascript function after an UpdatePanel asychronous (Ajax) request is over</title>
		<link>http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/</link>
		<comments>http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 13:18:03 +0000</pubDate>
		<dc:creator>zeemalik</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Asychronous post back]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Asynchronous post back]]></category>
		<category><![CDATA[Client side scripting]]></category>
		<category><![CDATA[EndRequestHandler]]></category>
		<category><![CDATA[UpdatePanel]]></category>

		<guid isPermaLink="false">http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/</guid>
		<description><![CDATA[If you are using AJAX then the only way i have found yet to give an alert to a user on return to the Asynchronous post back is to add an &#8220;end request&#8221; handler to the PageRequestManager.
In this way you can tell the request manager to run a javascript function on returning from a Asynchronous post back event of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeemalik.wordpress.com&blog=2188373&post=3&subd=zeemalik&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><font face="Times New Roman">If you are using AJAX then the only way i have found yet to give an alert to a user on return to the Asynchronous post back is to add an &#8220;end request&#8221; handler to the </font><span style="font-family:'Courier New';">PageRequestManager.</span></p>
<p><font face="Times New Roman">In this way you can tell the request manager to run a javascript function on returning from a Asynchronous post back event of AJAX.</font></p>
<p><font face="Times New Roman">Code for doing this is :</font></p>
<p><span style="font-family:'Courier New';">function load() </span></p>
<p><span style="font-family:'Courier New';">{<br />
   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);<br />
}</span></p>
<p><font face="Times New Roman">where &#8220;EndRequestHandler&#8221; will be the name of your javascript function you want to call.<br />
Call the above function in Onload event of &lt;body&gt; tag: </font></p>
<p><span style="font-family:'Courier New';">&lt;body onload=&#8221;load()&#8221;&gt;</span></p>
<p><font face="Times New Roman">function EndRequestHandler()</font></p>
<p><font face="Times New Roman">{</font></p>
<p><font face="Times New Roman">          alert(&#8220;You record has been saved successfully&#8221;);</font></p>
<p><font face="Times New Roman">}</font></p>
<p><font face="Times New Roman">Now If you want to give a different message based on your logic in server side code (code behind) then you can use a server side Hidden Field:</font></p>
<p><font face="Times New Roman"><span style="font-size:10pt;color:blue;">&lt;</span><span style="font-size:10pt;color:maroon;">input</span><span style="font-size:10pt;"> <span style="color:red;">id</span><span style="color:blue;">=&#8221;hdnValue&#8221;</span> <span style="color:red;">type</span><span style="color:blue;">=&#8221;hidden&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span>  <span style="color:red;">value</span><span style="color:blue;">=&#8221;"</span> <span style="color:blue;">/&gt;</span></span></font></p>
<p><font face="Times New Roman">Set its value in server side code on Asychronous Post Back: </font></p>
<p><font face="Times New Roman"><span style="color:blue;">Protected</span> <span style="color:blue;">Sub</span> btn_Click(<span style="color:blue;">ByVal</span> sender <span style="color:blue;">As</span> Object, <span style="color:blue;">ByVal</span> e <span style="color:blue;">As</span> System.EventArgs) <span style="color:blue;">Handles</span> btnCreateSample.Click</font></p>
<p><font face="Times New Roman"><span>    </span><span style="color:blue;">If</span> condition <span style="color:blue;">Then</span></font></p>
<blockquote><p><font face="Times New Roman"><span style="color:blue;"></span></font><font face="Times New Roman">hdnValue.value = &#8220;do this&#8221;</font></p></blockquote>
<p><font face="Times New Roman"><span>    </span><span style="color:blue;">Else</span></font><font face="Times New Roman"><span>      </span></font></p>
<blockquote><p><font face="Times New Roman"><span></span></font><font face="Times New Roman">hdnValue.value = &#8220;do that&#8221; </font></p></blockquote>
<p><font face="Times New Roman"><span style="color:blue;">    End If</span></font><span style="color:blue;"><font face="Times New Roman"><span>  </span></font></span></p>
<p><span style="color:blue;"><font face="Times New Roman"><span></span></font></span><span style="color:blue;"><font face="Times New Roman"><span></span>End Sub</font></span></p>
<p><span style="color:blue;"></span><font face="Times New Roman">Now you can check the value of this Hidden Field in your Client Side EndRequestHandler function and give a different alert to user based on its value:</font></p>
<p><font face="Times New Roman">function EndRequestHandler()<br />
</font><font face="Times New Roman">{<br />
</font><font face="Times New Roman">     if (document.getElementById(&#8216;&lt;%= hdnValue.ClientID %&gt;&#8217;).value == &#8220;do this&#8221;)</font></p>
<p><font face="Times New Roman">     { <br />
</font><font face="Times New Roman">          alert(&#8220;You record has been saved successfully&#8221;);<br />
</font><font face="Times New Roman">     } <br />
</font><font face="Times New Roman">     else<br />
</font><font face="Times New Roman">     {<br />
</font><font face="Times New Roman">          alert(&#8220;There is an error&#8221;);<br />
</font><font face="Times New Roman">     }<br />
</font><font face="Times New Roman"> }</font></p>
<table align="center" width="100%">
<tr vAlign="middle">
<td width="100%" align="left"><a target="_blank" href="http://www.addthis.com/bookmark.php" title="Bookmark using any bookmark manager!"><img border="0" width="125" src="http://s9.addthis.com/button1-bm.gif" alt="AddThis Social Bookmark Button" height="16" />  </a></td>
</tr>
<tr vAlign="middle">
<td width="100%" align="left">
<a href="http://www.linkedin.com/in/zeeshanmalik"><span style="font:80% Arial,sans-serif;color:#0783B6;"><img src="http://www.linkedin.com/img/webpromo/btn_in_20x15.gif" width="20" height="15" alt="View zeeshan malik's LinkedIn profile" style="vertical-align:middle;" border="0">View zeeshan malik&#8217;s profile</span></a>
</td>
</tr>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zeemalik.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zeemalik.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zeemalik.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zeemalik.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zeemalik.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zeemalik.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zeemalik.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zeemalik.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zeemalik.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zeemalik.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zeemalik.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zeemalik.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zeemalik.wordpress.com&blog=2188373&post=3&subd=zeemalik&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://zeemalik.wordpress.com/2007/11/27/how-to-call-client-side-javascript-function-after-an-updatepanel-asychronous-ajax-request-is-over/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/ba3c2fe89dcf18cff621c1ead5da5abb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zeemalik</media:title>
		</media:content>

		<media:content url="http://s9.addthis.com/button1-bm.gif" medium="image">
			<media:title type="html">AddThis Social Bookmark Button</media:title>
		</media:content>

		<media:content url="http://www.linkedin.com/img/webpromo/btn_in_20x15.gif" medium="image">
			<media:title type="html">View zeeshan malik's LinkedIn profile</media:title>
		</media:content>
	</item>
	</channel>
</rss>