<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A Glass case of Thoughts &#187; email</title>
	<atom:link href="http://jyotsna.philogy.com/tag/email/feed/" rel="self" type="application/rss+xml" />
	<link>http://jyotsna.philogy.com</link>
	<description>By Jyotsna Sonawane</description>
	<lastBuildDate>Mon, 06 Feb 2012 00:47:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jyotsna.philogy.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/144e3f216a63c20ec12e9fd5e8727bd2?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>A Glass case of Thoughts &#187; email</title>
		<link>http://jyotsna.philogy.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jyotsna.philogy.com/osd.xml" title="A Glass case of Thoughts" />
	<atom:link rel='hub' href='http://jyotsna.philogy.com/?pushpress=hub'/>
		<item>
		<title>Sending email through C#.net</title>
		<link>http://jyotsna.philogy.com/2008/12/09/sending-email-through-cnet/</link>
		<comments>http://jyotsna.philogy.com/2008/12/09/sending-email-through-cnet/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 07:06:32 +0000</pubDate>
		<dc:creator>Jyotsna</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://jyotsna.philogy.com/?p=24</guid>
		<description><![CDATA[Module: CEmailManager Calling function: Worker function: Where CGlobalParams: A class responsible for reading values for global parameters Global parameters used here: SMTPPassword    : somevalue SMTPPort   : 587 SMTPRequireSSL    : true SMTPServer    : smtp.gmail.com SMTPUser    : jyotsnas@philogy.com With currently set global parameters, the code sends email with gmail/ google apps over SSL. Setting the SMTPRequireSSL to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jyotsna.philogy.com&amp;blog=19356036&amp;post=24&amp;subd=jy0tsna&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration:underline;">Module:</span> CEmailManager<br />
<span style="text-decoration:underline;">Calling function:</span><br />
<pre class="brush: csharp;">
public static bool SendDummyEmail()
{
   return SendEmail(CGlobalParams.AdminEmail, &quot;dummy&quot;, &quot;Hi&quot;);
}</pre><br />
<span style="text-decoration:underline;">Worker function:</span><br />
<pre class="brush: csharp;">
private static bool SendEmail(string p_strTo, string p_strSubject, string p_strBody)
{
   try
   {
      MailMessage objMessage = new MailMessage();

      string[] lstRecipient = p_strTo.Split(',');
      foreach (string strTo in lstRecipient)
      {
          objMessage.To.Add(strTo);
      }

      objMessage.From = new MailAddress(CGlobalParams.SMTPUser, CGlobalParams.EmailSenderDisplay);
      objMessage.Subject = p_strSubject;
      objMessage.Body = p_strBody;

      SmtpClient objClient = new SmtpClient(CGlobalParams.SMTPServer, CGlobalParams.SMTPPort);
      objClient.UseDefaultCredentials = false;
      objClient.Credentials = new System.Net.NetworkCredential(CGlobalParams.SMTPUser, CGlobalParams.SMTPPassword);
      objClient.DeliveryMethod = SmtpDeliveryMethod.Network;

      if (CGlobalParams.SMTPRequireSSL)
      {
          objClient.EnableSsl = true;
      }

      objClient.Send(objMessage);

      return true;
   }
   catch
   {
     return false;
   }
}
</pre><br />
<span style="text-decoration:underline;">Where</span></p>
<p>CGlobalParams: A class responsible for reading values for global parameters</p>
<p>Global parameters used here:</p>
<p>SMTPPassword    : somevalue<br />
SMTPPort   : 587<br />
SMTPRequireSSL    : true<br />
SMTPServer    : smtp.gmail.com<br />
SMTPUser    : jyotsnas@philogy.com</p>
<p>With currently set global parameters, the code sends email with gmail/ google apps over SSL. Setting the SMTPRequireSSL to false, will make the code send email with SMTP server which requires authentication but not SSL.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jy0tsna.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jy0tsna.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jy0tsna.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jyotsna.philogy.com&amp;blog=19356036&amp;post=24&amp;subd=jy0tsna&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jyotsna.philogy.com/2008/12/09/sending-email-through-cnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/59272e407d1ae02c38c11a03dbd61cc2?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=X" medium="image">
			<media:title type="html">pixperiments</media:title>
		</media:content>
	</item>
	</channel>
</rss>
