<?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/"
	>

<channel>
	<title>Lesnikowski Blog &#187; Component</title>
	<atom:link href="http://www.lesnikowski.com/blog/category/component/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lesnikowski.com/blog</link>
	<description>EMAIL IMAP POP3 SMTP FTP FTPS barcode components blog</description>
	<lastBuildDate>Fri, 03 Feb 2012 19:20:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Archive email in Gmail</title>
		<link>http://www.lesnikowski.com/blog/archive-email-in-gmail/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=archive-email-in-gmail</link>
		<comments>http://www.lesnikowski.com/blog/archive-email-in-gmail/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 10:54:01 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[Mail.dll]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2240</guid>
		<description><![CDATA[First remember to enable IMAP in Gmail. You need to use DeleteMessageByUID method. Messages will be still available in All Mail folder. // C# using(Imap imap = new Imap()) { imap.ConnectSSL(&#34;imap.gmail.com&#34;); imap.Login(&#34;user&#34;, &#34;password&#34;); // Find all emails we want to delete imap.SelectInbox(); List&#60;long&#62; uids = imap.Search( Expression.Subject(&#34;email to archive&#34;)); imap.DeleteMessageByUID(uids); imap.Close(); } ' VB.NET Using [...]]]></description>
			<content:encoded><![CDATA[<p>First remember to <a href="http://www.lesnikowski.com/blog/enable-imap-in-gmail/">enable IMAP in Gmail</a>.</p>
<p>You need to use DeleteMessageByUID method. Messages will be still available in All Mail folder.</p>
<pre class="brush: csharp;">
// C#

using(Imap imap = new Imap())
{
	imap.ConnectSSL(&quot;imap.gmail.com&quot;);
	imap.Login(&quot;user&quot;, &quot;password&quot;);

	// Find all emails we want to delete
	imap.SelectInbox();
	List&lt;long&gt; uids = imap.Search(
		Expression.Subject(&quot;email to archive&quot;));

	imap.DeleteMessageByUID(uids);

	imap.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET

Using imap As New Imap()
	imap.ConnectSSL(&quot;imap.gmail.com&quot;)
	imap.Login(&quot;user@gmail.com&quot;, &quot;password&quot;)

	' Find all emails we want to delete
	imap.SelectInbox()
	Dim uids As List(Of Long) = imap.Search(_
		Expression.Subject(&quot;email to archive&quot;))

	imap.DeleteMessageByUID(uids)

	imap.Close()
End Using
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/archive-email-in-gmail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send iCalendar meeting requests for different timezone</title>
		<link>http://www.lesnikowski.com/blog/send-icalendar-meeting-requests-for-different-timezone/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=send-icalendar-meeting-requests-for-different-timezone</link>
		<comments>http://www.lesnikowski.com/blog/send-icalendar-meeting-requests-for-different-timezone/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 14:18:57 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[iCalendar]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=1842</guid>
		<description><![CDATA[Usually you define time of an event in relation to UTC time zone. If you need to define event on 9:00 o&#8217;clock in Alaska you simply need to subtract 9 hours from event time to get the event time in UTC (18:00:00). 18 &#8211; 9 = 9. It all works great in December (Alaska is [...]]]></description>
			<content:encoded><![CDATA[<p>Usually you define time of an event in relation to UTC time zone.</p>
<p>If you need to define event on 9:00 o&#8217;clock in Alaska you simply need<br />
to subtract 9 hours from event time to get the event time in UTC<br />
(18:00:00). 18 &#8211; 9 = 9.</p>
<p>It all works great in December (Alaska is UTC-9), but in May, daylight<br />
saving time is in effect in Alaska (Alaska is UTC-8 then).</p>
<p>If the event is recurring, in May, event is going to be held on 10:00<br />
Alaska time (18 &#8211; 8 = 10). Which is most likely not what you want.</p>
<p>As the time zones in different parts of world change way to often to reflect these changes in Mail.dll,<br />
you&#8217;ll need to specify the time zone when creating new event (including the daylight savings time).</p>
<p>Here&#8217;s the sample:</p>
<pre class="brush: csharp;">
// C#
using Fluent = Lesnikowski.Mail.Fluent;
using Lesnikowski.Client;
using Lesnikowski.Mail;
using Lesnikowski.Mail.Appointments;

Appointment appointment = new Appointment();

// Create time zone
VTimeZone alaska = appointment.AddTimeZone();
alaska.TimeZoneId = &quot;America/Anchorage&quot;;

// Define standard time offset
var standardRecurring = new RecurringRule();
standardRecurring.Frequency = Frequency.Yearly;
standardRecurring.ByDay.Add(Weekday.Sunday);
standardRecurring.ByMonths.Add(11);

var standard = new StandardOffset
{
    Name = &quot;AKST&quot;,
    Start = new DateTime(1970, 11, 01, 02, 00, 00),
    OffsetFrom = TimeSpan.FromHours(-8),
    OffsetTo = TimeSpan.FromHours(-9),
    RecurringRule = standardRecurring
};

// Define daylight time offset
var daylightRecurring = new RecurringRule();
daylightRecurring.Frequency = Frequency.Yearly;
daylightRecurring.ByDay.Add(new Weekday(2, Weekday.Sunday));
daylightRecurring.ByMonths.Add(3);

var daylight = new DaylightOffset
{
    Name = &quot;AKDT&quot;,
    Start = new DateTime(1970, 03, 08, 02, 00, 00),
    OffsetFrom = TimeSpan.FromHours(-9),
    OffsetTo = TimeSpan.FromHours(-8),
    RecurringRule = daylightRecurring
};

alaska.Standard.Add(standard);
alaska.Daylight.Add(daylight);

// Define event
Event e = appointment.AddEvent();
e.Start = new DateTime(2007, 08, 17, 12, 00, 00);
e.End = new DateTime(2007, 08, 17, 12, 30, 00);
e.Summary = &quot;At noon in Alaska&quot;;
e.InTimeZone(alaska);

e.SetOrganizer(new Person(&quot;Alice&quot;, &quot;alice@example.org&quot;));

e.AddParticipant(new Participant(
    &quot;Bob&quot;, &quot;bob@example.org&quot;, ParticipationRole.Required, true));
e.AddParticipant(new Participant(
    &quot;Tom&quot;, &quot;tom@example.org&quot;, ParticipationRole.Optional, true));
e.AddParticipant(new Participant(
    &quot;Alice&quot;, &quot;alice@example.org&quot;, ParticipationRole.Required, true));

Alarm alarm = e.AddAlarm();
alarm.BeforeStart(TimeSpan.FromMinutes(15));

IMail email = Fluent.Mail
    .Text(&quot;Status meeting at noon in Alaska.&quot;)
    .Subject(&quot;Status meeting&quot;)
    .From(&quot;alice@example.org&quot;)
    .To(&quot;bob@example.org&quot;)
    .To(&quot;tom@example.org&quot;)
    .AddAppointment(appointment)
    .Create();

using (Smtp smtp = new Smtp())
{
    smtp.Connect(&quot;smtp.example.org&quot;); // or ConnectSSL
    smtp.Login(&quot;user&quot;, &quot;password&quot;);
    smtp.SendMessage(email);
    smtp.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET
Imports Fluent = Lesnikowski.Mail.Fluent
Imports Lesnikowski.Client
Imports Lesnikowski.Mail
Imports Lesnikowski.Mail.Appointments

Dim appointment As New Appointment()

' Create time zone
Dim alaska As VTimeZone = appointment.AddTimeZone()
alaska.TimeZoneId = &quot;America/Anchorage&quot;

' Define standard time offset
Dim standardRecurring = New RecurringRule()
standardRecurring.Frequency = Frequency.Yearly
standardRecurring.ByDay.Add(Weekday.Sunday)
standardRecurring.ByMonths.Add(11)

Dim standard = New StandardOffset() With { _
	.Name = &quot;AKST&quot;, _
	.Start = New DateTime(1970, 11, 1, 2, 0, 0), _
	.OffsetFrom = TimeSpan.FromHours(-8), _
	.OffsetTo = TimeSpan.FromHours(-9), _
	.RecurringRule = standardRecurring _
}

' Define daylight time offset
Dim daylightRecurring = New RecurringRule()
daylightRecurring.Frequency = Frequency.Yearly
daylightRecurring.ByDay.Add(New Weekday(2, Weekday.Sunday))
daylightRecurring.ByMonths.Add(3)

Dim daylight = New DaylightOffset() With { _
	.Name = &quot;AKDT&quot;, _
	.Start = New DateTime(1970, 3, 8, 2, 0, 0), _
	.OffsetFrom = TimeSpan.FromHours(-9), _
	.OffsetTo = TimeSpan.FromHours(-8), _
	.RecurringRule = daylightRecurring _
}

alaska.Standard.Add(standard)
alaska.Daylight.Add(daylight)

' Define event
Dim e As [Event] = appointment.AddEvent()
e.Start = New DateTime(2007, 8, 17, 12, 0, 0)
e.[End] = New DateTime(2007, 8, 17, 12, 30, 0)
e.Summary = &quot;At noon in Alaska&quot;
e.InTimeZone(alaska)

e.SetOrganizer(New Person(&quot;Alice&quot;, &quot;alice@example.org&quot;))

e.AddParticipant(New Participant( _
	&quot;Bob&quot;, &quot;bob@example.org&quot;, ParticipationRole.Required, True))
e.AddParticipant(New Participant( _
	&quot;Tom&quot;, &quot;tom@example.org&quot;, ParticipationRole.[Optional], True))
e.AddParticipant(New Participant( _
	&quot;Alice&quot;, &quot;alice@example.org&quot;, ParticipationRole.Required, True))

Dim alarm As Alarm = e.AddAlarm()
alarm.BeforeStart(TimeSpan.FromMinutes(15))

Dim email As IMail = Fluent.Mail _
	.Text(&quot;Status meeting at noon in Alaska.&quot;) _
	.Subject(&quot;Status meeting&quot;) _
	.From(&quot;alice@example.org&quot;) _
	.[To](&quot;bob@example.org&quot;) _
	.[To](&quot;tom@example.org&quot;) _
	.AddAppointment(appointment) _
	.Create()

Using smtp As New Smtp()
	smtp.Connect(&quot;smtp.example.org&quot;) 	' or ConnectSSL
	smtp.Login(&quot;user&quot;, &quot;password&quot;)
	smtp.SendMessage(email)
	smtp.Close()
End Using
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/send-icalendar-meeting-requests-for-different-timezone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reply to an email</title>
		<link>http://www.lesnikowski.com/blog/reply-to-email/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=reply-to-email</link>
		<comments>http://www.lesnikowski.com/blog/reply-to-email/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 09:53:34 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2188</guid>
		<description><![CDATA[You can use Mail.dll to reply to an HTML or plain-text email. ReplyBuilder class allows you to specify custom HTML and plain-text templates for the reply. Mail.dll will parse HTML extract body part, and build-in template engine will do the rest. The next great thing is that plain-text version of the email is generated automatically. [...]]]></description>
			<content:encoded><![CDATA[<p>You can use Mail.dll to reply to an HTML or plain-text email.</p>
<p>ReplyBuilder class allows you to specify custom HTML and plain-text templates for the reply. Mail.dll will parse HTML extract body part, and build-in template engine will do the rest.</p>
<p>The next great thing is that plain-text version of the email is generated automatically.</p>
<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/12/reply.png" alt="" title="reply" width="429" height="388" class="aligncenter size-full wp-image-2197" /></p>
<pre class="brush: csharp;">
// C#

IMail original = ...;

ReplyBuilder replyBuilder = original.Reply();
// You can specify your own custom template:
replyBuilder.HtmlReplyTemplate =
    &quot;[Html]&quot; +
    &quot;&lt;br /&gt;&lt;br /&gt;&quot; +
    &quot;On [Original.Date] [Original.Sender.Name] wrote:&quot; +
    &quot;&lt;blockquote &quot; +
        &quot;style='margin-left: 1em; &quot; +
        &quot;padding-left: 1em; &quot; +
        &quot;border-left: 1px #ccc solid;'&gt;&quot; +
    &quot;[QuoteHtml]&quot; +
    &quot;&lt;/blockquote&gt;&quot;;

replyBuilder.Html =
    &quot;Alice, &lt;br/&gt;&lt;br/&gt;thanks for your email.&quot;;

MailBuilder builder = replyBuilder.ReplyToAll(
    new MailBox(&quot;bob@example.org&quot;, &quot;Bob&quot;));

// You can add attachments to your reply
//builder.AddAttachment(&quot;report.csv&quot;);

IMail reply = builder.Create();

using (Smtp smtp = new Smtp())
{
    smtp.Connect(&quot;smtp.example.com&quot;); // or ConnectSSL
    smtp.Login(&quot;user&quot;, &quot;password&quot;);
    smtp.SendMessage(reply);
    smtp.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET

Dim original As IMail = ...

Dim replyBuilder As ReplyBuilder = original.Reply()

' You can specify your own custom template:
replyBuilder.HtmlReplyTemplate = _
    &quot;[Html]&quot; + _
    &quot;&lt;br /&gt;&lt;br /&gt;&quot; + _
    &quot;On [Original.Date] [Original.Sender.Name] wrote:&quot; + _
    &quot;&lt;blockquote &quot; + _
        &quot;style='margin-left: 1em; &quot; + _
        &quot;padding-left: 1em; &quot; + _
        &quot;border-left: 1px #ccc solid;'&gt;&quot; + _
    &quot;[QuoteHtml]&quot; + _
    &quot;&lt;/blockquote&gt;&quot;

replyBuilder.Html = _
    &quot;Alice, &lt;br/&gt;&lt;br/&gt;thanks for your email.&quot;

Dim builder As MailBuilder = replyBuilder.ReplyToAll( _
    New MailBox(&quot;bob@example.org&quot;, &quot;Bob&quot;))

' You can add attachments to your reply
'builder.AddAttachment(&quot;report.csv&quot;)

Dim reply As IMail = builder.Create()

Using smtp As New Smtp()
	smtp.Connect(&quot;smtp.example.com&quot;)
	smtp.Login(&quot;user&quot;, &quot;password&quot;) ' or ConnectSSL
	smtp.SendMessage(reply)
	smtp.Close()
End Using
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/reply-to-email/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Extract plain text from HTML email</title>
		<link>http://www.lesnikowski.com/blog/extract-plain-text-from-html-email/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=extract-plain-text-from-html-email</link>
		<comments>http://www.lesnikowski.com/blog/extract-plain-text-from-html-email/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 16:59:24 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[Mail.dll]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2185</guid>
		<description><![CDATA[Mail.dll MIME and Email API’s may be used to extract the plain-text body and HTML body from an email message. If a message contains plain-text, no conversion is necessary. It’s simply a matter of using the Text property of IMail interface. If however the email does not contain plain-text and only HTML content is available [...]]]></description>
			<content:encoded><![CDATA[<p>Mail.dll MIME and Email API’s may be used to extract the plain-text body and HTML body from an email message.</p>
<p>If a message contains plain-text, no conversion is necessary. It’s simply a matter of using the Text property of IMail interface.</p>
<p>If however the email does not contain plain-text and only HTML content is available <strong>GetTextFromHtml </strong>method may be used to <strong>convert the HTML to plain-text</strong>.</p>
<p>The internal conversion process is much more sophisticated than can be accomplished with the simple regular-expression code. This is more than simply removing HTML tags from an HTML document.</p>
<p>Mail.dll contains <strong>full-blown HTML parser</strong> that handles script tags, comments, CDATA and even incorrect HTML.</p>
<p>The following C# and VB.NET code extracts plain-text from the HTML body of the email message:</p>
<pre class="brush: csharp;">
// C#

IMail email = ...

string text = email.Text;
if (string.IsNullOrEmpty(text) &amp;&amp; email.IsHtml)
{
    text = email.GetTextFromHtml();
}
Console.WriteLine(text);
</pre>
<p>The following C# code extracts the HTML body from this MIME message and converts the HTML to plain-text:</p>
<pre class="brush: vb;">
' VB.NET

Dim email As IMail = ...

Dim text As String = email.Text
If String.IsNullOrEmpty(text) AndAlso email.IsHtml Then
	text = email.GetTextFromHtml()
End If
Console.WriteLine(text)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/extract-plain-text-from-html-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send email to multiple recipients</title>
		<link>http://www.lesnikowski.com/blog/send-email-to-multiple-recipients/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=send-email-to-multiple-recipients</link>
		<comments>http://www.lesnikowski.com/blog/send-email-to-multiple-recipients/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 14:41:07 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2148</guid>
		<description><![CDATA[The easiest way is to use BCC field (Blind-Carbon-Copy),  and specify Undisclosed recipients group as the message recipient. // C# version MailBuilder builder = new MailBuilder(); builder.From.Add(new MailBox(&#34;alice@example.com&#34;, &#34;Alice&#34;)); builder.To.Add(new MailGroup(&#34;Undisclosed recipients&#34;)); builder.Bcc.Add(new MailBox(&#34;bob@example.com&#34;, &#34;Bob&#34;)); builder.Bcc.Add(new MailBox(&#34;tom@example.com&#34;, &#34;Tom&#34;)); builder.Bcc.Add(new MailBox(&#34;john@example.com&#34;, &#34;John&#34;)); builder.Subject = &#34;Put subject here&#34;; builder.Html = &#34;Put &#60;strong&#62;HTML&#60;/strong&#62; message here.&#34;; // Plain text is [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way is to use <strong>BCC </strong>field (Blind-Carbon-Copy),  and specify <strong>Undisclosed recipients</strong> group as the message recipient.</p>
<pre class="brush: csharp;">
// C# version

MailBuilder builder = new MailBuilder();
builder.From.Add(new MailBox(&quot;alice@example.com&quot;, &quot;Alice&quot;));
builder.To.Add(new MailGroup(&quot;Undisclosed recipients&quot;));

builder.Bcc.Add(new MailBox(&quot;bob@example.com&quot;, &quot;Bob&quot;));
builder.Bcc.Add(new MailBox(&quot;tom@example.com&quot;, &quot;Tom&quot;));
builder.Bcc.Add(new MailBox(&quot;john@example.com&quot;, &quot;John&quot;));

builder.Subject = &quot;Put subject here&quot;;
builder.Html = &quot;Put &lt;strong&gt;HTML&lt;/strong&gt; message here.&quot;;

// Plain text is automatically generated, but you can change it:
//builder.Text = &quot;Put plain text message here.&quot;;

IMail email = builder.Create();

// Send the message
using (Smtp smtp = new Smtp())
{
    smtp.Connect(&quot;server.example.com&quot;);   // or ConnectSSL for SSL
    smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;); // remove if not needed

    smtp.SendMessage(email);

    smtp.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET version

Dim builder As New MailBuilder()
builder.From.Add(New MailBox(&quot;alice@example.com&quot;, &quot;Alice&quot;))
builder.[To].Add(New MailGroup(&quot;Undisclosed recipients&quot;))

builder.Bcc.Add(New MailBox(&quot;bob@example.com&quot;, &quot;Bob&quot;))
builder.Bcc.Add(New MailBox(&quot;tom@example.com&quot;, &quot;Tom&quot;))
builder.Bcc.Add(New MailBox(&quot;john@example.com&quot;, &quot;John&quot;))

builder.Subject = &quot;Put subject here&quot;
builder.Htm = &quot;Put &lt;strong&gt;HTML&lt;/strong&gt; message here.&quot;

' Plain text is automatically generated, but you can change it:
'builder.Text =&quot;Put plain text message here.&quot;

Dim email As IMail = builder.Create()

' Send the message
Using smtp As New Smtp()
	smtp.Connect(&quot;server.example.com&quot;)    ' or ConnectSSL for SSL
	smtp.UseBestLogin(&quot;user&quot;, &quot;password&quot;)  ' remove if not needed

	smtp.SendMessage(email)

	smtp.Close()
End Using
</pre>
<p>Also take a look at <a href="http://www.lesnikowski.com/blog/email-template-engine">Mail.dll&#8217;s templating engine</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/send-email-to-multiple-recipients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import certificate, private or public keys (PEM, CER, PFX)</title>
		<link>http://www.lesnikowski.com/blog/import-certificate-private-public-keys-pem-cer-pfx/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=import-certificate-private-public-keys-pem-cer-pfx</link>
		<comments>http://www.lesnikowski.com/blog/import-certificate-private-public-keys-pem-cer-pfx/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 12:09:58 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[DKIM]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[SMIME]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2089</guid>
		<description><![CDATA[Encrypted private key, RSA private key in PEM file: PEM stands for Privacy Enhanced Mail format. PemReader pem = new PemReader(); RSACryptoServiceProvider rsa = pem.ReadEncryptedPrivateKeyFromFile( &#34;EncryptedPrivateKey.pem&#34;, // &#34;EncryptedRSAPrivateKey.pem&#34; &#34;cypher&#34;); This code handles following formats: PKCS #8 EncryptedPrivateKeyInfo Encrypted Format: -----BEGIN ENCRYPTED PRIVATE KEY----- MIICojAcBgoqhkiG9w0BD ..... Private Key (Traditional SSLeay RSAPrivateKey format) Encrypted: -----BEGIN RSA PRIVATE [...]]]></description>
			<content:encoded><![CDATA[<h2>Encrypted private key, RSA private key in <strong>PEM</strong> file:</h2>
<p>PEM stands for Privacy Enhanced Mail format.</p>
<pre class="brush: csharp;">
PemReader pem = new PemReader();
RSACryptoServiceProvider rsa = pem.ReadEncryptedPrivateKeyFromFile(
   &quot;EncryptedPrivateKey.pem&quot;, // &quot;EncryptedRSAPrivateKey.pem&quot;
   &quot;cypher&quot;);
</pre>
<p>This code handles following formats:</p>
<p> PKCS #8  EncryptedPrivateKeyInfo Encrypted Format:<br />
<code><br />
        -----BEGIN ENCRYPTED PRIVATE KEY-----<br />
        MIICojAcBgoqhkiG9w0BD .....<br />
</code></p>
<p>Private Key (Traditional SSLeay RSAPrivateKey format) Encrypted:<br />
<code><br />
        -----BEGIN RSA PRIVATE KEY-----<br />
        Proc-Type: 4,ENCRYPTED<br />
        DEK-Info: DES-EDE3-CBC,24A667C253F8A1B9</p>
<p>        mKz .....<br />
</code></p>
<p>You can remove the passphrase from the private key:<br />
openssl rsa -in EncryptedPrivateKey.pem -out PrivateKey.pem</p>
<h2>Unencrypted private key in <strong>PEM</strong> file:</h2>
<pre class="brush: csharp;">
PemReader pem = new PemReader();
RSACryptoServiceProvider rsa = pem.ReadPrivateKeyFromFile(
   &quot;PrivateKey.pem&quot;);
</pre>
<p>This code handles following formats:</p>
<p>PKCS #8  PrivateKeyInfo Unencrypted:<br />
<code><br />
        -----BEGIN PRIVATE KEY-----<br />
        MIICdgIBADANBgkqhkiG9w0B ......<br />
</code></p>
<p>Private Key (Traditional SSLeay RSAPrivateKey format) Unencrypted:<br />
<code><br />
        -----BEGIN RSA PRIVATE KEY-----<br />
        MIICXQIBAAKBgQCcHVm  .....<br />
</code></p>
<h2>Public key in <strong>PEM</strong> file:</h2>
<pre class="brush: csharp;">
PemReader pem = new PemReader();
RSACryptoServiceProvider rsa = pem.ReadPublicKeyFromFile(
   &quot;PublicKey.pem&quot;)
</pre>
<p>This code handles following formats:</p>
<p>Public Key (SubjecPublicKeyInfo):<br />
<code><br />
        -----BEGIN PUBLIC KEY-----<br />
        MIGfMA0GCSqGSIb3DQEB .....<br />
</code></p>
<h2>Certificate/private key in <strong>PFX</strong> file:</h2>
<pre class="brush: csharp;">
X509Certificate2 certificate  = new X509Certificate2(
   &quot;certificate.pfx&quot;,
   &quot;&quot;,
   X509KeyStorageFlags.PersistKeySet)

if (certificate.HasPrivateKey)
{
  using (RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)certificate.PrivateKey)
  {
  }
}
</pre>
<h2>Certificate in <strong>PEM/CER</strong> file</h2>
<p>Note: The private key is never stored in a .pem/.cer file.</p>
<pre class="brush: csharp;">
X509Certificate2 certificate = new X509Certificate2(
   &quot;certificate.cer&quot;);
</pre>
<p>-or-</p>
<pre class="brush: csharp;">
PemReader pem = new PemReader();
X509Certificate2 certificate = pem.ReadCertificateFromFile(
   &quot;certificate.cer&quot;);
</pre>
<p>This code handles following formats:</p>
<p><code><br />
        -----BEGIN CERTIFICATE-----<br />
        MIIFsTCCA5mgAwIBAgIKYQ .....<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/import-certificate-private-public-keys-pem-cer-pfx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mail.dll .NET email spam filter</title>
		<link>http://www.lesnikowski.com/blog/mail-dll-net-email-spam-filter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mail-dll-net-email-spam-filter</link>
		<comments>http://www.lesnikowski.com/blog/mail-dll-net-email-spam-filter/#comments</comments>
		<pubDate>Sat, 22 Oct 2011 10:49:29 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[Spam]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2075</guid>
		<description><![CDATA[Mail.dll .NET email component includes high accuracy anti-spam filter. It uses enhanced naive Bayesian classifier, specifically modified to handle email messages. Bayesian spam filters are a very powerful technique for dealing with spam. In our tests we achieved 99,6% accuracy with very low false positive spam detection rates (9 false positives in 54&#8217;972 emails tested [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lesnikowski.com/mail/">Mail.dll .NET email component</a> includes high accuracy <strong>anti-spam filter</strong>.</p>
<p>It uses enhanced naive Bayesian classifier, specifically modified to handle email messages. Bayesian spam filters are a very powerful technique for dealing with spam.</p>
<p>In our tests we achieved <strong>99,6% accuracy</strong> with very low false positive spam detection rates (9 false positives in 54&#8217;972 emails tested &#8211; that&#8217;s 0.016%).</p>
<h3>Training</h3>
<p>First in the learning phase, you need to teach the classifier to recognize spam and non-spam (ham) messages. You need to prepare 100-200 spam and ham messages. </p>
<p>I suggest using following folder structure:</p>
<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/10/Bayes_FolderStructure.png" alt="" title="Bayes_FolderStructure" width="480" height="149" class="aligncenter size-full wp-image-2076" /></p>
<p>&#8220;Learn&#8221; folder is used for training the filter. Both spam and ham folders should contain around 100-200 messages each (the more the better). <strong>The number of messages in spam and ham folders must be equal</strong>. You can find a spam archive on the bottom of the article.</p>
<p>Messages must be in eml format with correct line endings (rn or 13 10 hex).</p>
<p>Now we use <em>SpamFilterTeacher </em> class to teach <em>BayesianMailFilter</em>:</p>
<pre class="brush: csharp;">
// C#
using Lesnikowski.Mail.Tools.Spam;

BayesianMailFilter filter = new BayesianMailFilter();
SpamFilterTeacher teacher = new SpamFilterTeacher(filter);
teacher.TeachSpam(@&quot;c:bayeslearnspam&quot;);
teacher.TeachHam(@&quot;c:bayeslearnham&quot;);
</pre>
<h3>Testing</h3>
<p>&#8220;Test&#8221; folder is used for testing our filter:</p>
<pre class="brush: csharp;">
// C#

SpamTestResults r = teacher.Test(
    @&quot;c:bayestestspam&quot;,
    @&quot;c:bayestestham&quot;);

Console.WriteLine(r);
r.FalsePositives.ForEach(Console.WriteLine);
r.NotMarkedAsSpam.ForEach(Console.WriteLine);
</pre>
<p>The results should be similar to this:<br />
<code><br />
Accuracy=0.9949, False positives=9, Not marked as spam=271, Tests count=54972<br />
c:bayestestham�16874.eml<br />
...<br />
</code></p>
<p>When the filter is trained and the results are satisfactory, you can <strong>save it to disk</strong>:</p>
<pre class="brush: csharp;">
// C#

filter.Save(&quot;c:\20111022.mbayes&quot;);
</pre>
<h3>Using</h3>
<p>You can load the filter from disk and check individual messages:</p>
<pre class="brush: csharp;">
// C#

BayesianMailFilter filter = new BayesianMailFilter();
filter.Load(&quot;c:\20111022.mbayes&quot;);

// you can use Mail.dll to download mesage from POP3 or IMAP server:
string eml = ... 

IMail email = new MailBuilder().CreateFromEml(eml);

SpamResult result = filter.Examine(email);
Console.WriteLine(result.Probability);
Console.WriteLine(result.IsSpam);
</pre>
<p>If the filter incorrectly recognizes the message you can train it again:</p>
<pre class="brush: csharp;">
// C#

filter.LearnSpam(email);
// - or -
filter.LearnHam(email);

filter.Save(&quot;c:\20111022.mbayes&quot;);
</pre>
<h3>Spam archives</h3>
<p>For most recent spam you can check this great archive: <a href="http://www.untroubled.org/spam/" rel="no_follow">http://www.untroubled.org/spam/</a>.<br />
Unfortunately messages <strong>don&#8217;t have correct extension</strong> (*.eml) and <strong>line endings are incorrect</strong>.</p>
<p>You can download spam archive including 7874 spam messages from Oct 2011 here:<br />
<a href="http://www.lesnikowski.com/mail/spam/spam201110.zip">http://www.lesnikowski.com/mail/spam/spam201110.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/mail-dll-net-email-spam-filter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>OAuth with Gmail</title>
		<link>http://www.lesnikowski.com/blog/oauth-with-gmail/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=oauth-with-gmail</link>
		<comments>http://www.lesnikowski.com/blog/oauth-with-gmail/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 17:27:39 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[XOAuth]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2030</guid>
		<description><![CDATA[OAuth is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications. In this post I&#8217;ll show how to access Gmail account using 3-legged OAuth authentication method. The key advantage of this method is that it allows an application to access user email without knowing user&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2009/11/gmail.png" alt="" title="gmail" width="131" height="61" class="alignleft size-full wp-image-271" /></p>
<p><strong>OAuth </strong> is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.</p>
<p>In this post<strong> I&#8217;ll show how to access Gmail</strong> account using 3-legged OAuth authentication method. The key advantage of this method is that it allows an application to access user email <strong>without knowing user&#8217;s password.</strong></p>
<p>You can read more on OAuth authentication with Google accounts here:<br />
<a href="http://code.google.com/apis/accounts/docs/OAuth_ref.html">http://code.google.com/apis/accounts/docs/OAuth_ref.html</a></p>
<p>Gmail IMAP and SMTP using OAuth:<br />
<a href="http://code.google.com/apis/gmail/oauth/protocol.html">http://code.google.com/apis/gmail/oauth/protocol.html</a></p>
<p>If your application/website is not registered, you should use following key and secret:<br />
consumer key: &#8220;anonymous&#8221;<br />
consumer secret: &#8220;anonymous&#8221;</p>
<p>Remember to add reference to Maill.dll and appropriate namespaces.</p>
<pre class="brush: csharp;">
// C#

using Lesnikowski.Client.IMAP;
using Lesnikowski.Client.Authentication;
using Lesnikowski.Client.Authentication.Google;

const string userEmailAccount = &quot;pat@gmail.com&quot;;
const string consumerKey = &quot;anonymous&quot;;
const string consumerSecret = &quot;anonymous&quot;;

GmailOAuth oauth = new GmailOAuth(
    consumerKey, consumerSecret);

string url = oauth.GetAuthorizationUrl(&quot;http://localhost:64119/&quot;);

Process.Start(url);
// You can use Response.Redirect(url) in ASP.NET

string oauthVerifier = HttpUtility.UrlDecode(Console.ReadLine());
// You can use Request[&quot;oauth_verifier&quot;].ToString() in ASP.NET

oauth.GetAccessToken(oauthVerifier);

using (Imap client = new Imap())
{
    client.ConnectSSL(&quot;imap.gmail.com&quot;);
    string oauthImapKey = oauth.GetXOAuthKeyForImap();
    client.LoginOAUTH(oauthImapKey);

    // Now you can access user's emails
    //...

    client.Close();
    oauth.RevokeToken(oauthImapKey);
}
</pre>
<p>1.<br />
<strong>GmailOAuth.GetAuthorizationUrl</strong> method returns url you should redirect your user to so he can authorize access.<br />
As you can see Mail.dll is asking for access to user&#8217;s email information and Gmail access:</p>
<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/10/GmailOAuth_Authorize.png" alt="" title="GmailOAuth_Authorize" width="536" height="537" class="aligncenter size-full wp-image-2043" /></p>
<p>2.<br />
If you<strong> don&#8217;t specify callback</strong> parameter, user will have to <strong>manually </strong>copy&#038;paste the token to your application:</p>
<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/10/GmailOAuth_OOBAuthorize.png" alt="" title="GmailOAuth_OOBAuthorize" width="536" height="350" class="aligncenter size-full wp-image-2044" /></p>
<p>In case of a <strong>web project</strong>, you can specify<strong> a web address on your website</strong>. oauth_verifier will be included as the redirection url parameter.</p>
<p>After the redirection, your website/application needs to<strong> read oauth_verifier query parameter</strong>:</p>
<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/10/GmailOAuth_Redirect.png" alt="" title="GmailOAuth_Redirect" width="536" height="133" class="aligncenter size-full wp-image-2045" /></p>
<p>3.<br />
<strong>GmailOAuth.GetAccessToken</strong> method authorizes the token.</p>
<p>4.<br />
<strong>GmailOAuth.GetXOAuthKeyForImap</strong> method <strong>uses Google API to get the email address</strong> of the user, and generates XOAuth key for IMAP protocol (you can use GetXOAuthKeyForSmtp for SMTP).</p>
<p>5.<br />
<strong>GmailOAuth.RevokeToken</strong> method <strong>revokes XOAuth key</strong>, so no further access can be made with it.</p>
<p>&#8230;and finally VB.NET version of the code:</p>
<pre class="brush: vb;">
' VB.NET

Imports Lesnikowski.Client.IMAP
Imports Lesnikowski.Client.Authentication
Imports Lesnikowski.Client.Authentication.Google

Const userEmailAccount As String = &quot;pat@gmail.com&quot;
Const consumerKey As String = &quot;anonymous&quot;
Const consumerSecret As String = &quot;anonymous&quot;

Dim oauth As New GmailOAuth(consumerKey, consumerSecret)

Dim url As String = oauth.GetAuthorizationUrl(&quot;http://localhost:64119/&quot;)

Process.Start(url)
' You can use Response.Redirect(url) in ASP.NET

Dim oauthVerifier As String = HttpUtility.UrlDecode(Console.ReadLine())
' You can use Request[&quot;oauth_verifier&quot;].ToString() in ASP.NET

oauth.GetAccessToken(oauthVerifier)

Using client As New Imap()
	client.ConnectSSL(&quot;imap.gmail.com&quot;)
	Dim oauthImapKey As String = oauth.GetXOAuthKeyForImap()
	client.LoginOAUTH(oauthImapKey)

	' Now you can access user's emails
	'...

	client.Close()
	oauth.RevokeToken(oauthImapKey)
End Using
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/oauth-with-gmail/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2-legged OAuth with Gmail</title>
		<link>http://www.lesnikowski.com/blog/2-legged-oauth-with-gmail/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=2-legged-oauth-with-gmail</link>
		<comments>http://www.lesnikowski.com/blog/2-legged-oauth-with-gmail/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 16:31:02 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[Mail.dll]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[XOAuth]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2031</guid>
		<description><![CDATA[OAuth is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications. In this post I&#8217;ll show how to access Gmail account using 2-legged OAuth authentication method. The basic idea is that domain administrator can use this method to access user email without knowing user&#8217;s password. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2009/11/gmail.png" alt="" title="gmail" width="131" height="61" class="alignleft size-full wp-image-271" /></p>
<p><strong>OAuth </strong> is an open protocol to allow secure API authorization in a simple and standard method from desktop and web applications.</p>
<p>In this post<strong> I&#8217;ll show how to access Gmail</strong> account using 2-legged OAuth authentication method. The basic idea is that domain administrator can use this method to access user email <strong>without knowing user&#8217;s password.</strong></p>
<p>You can read more on OAuth authentication with Google accounts here:<br />
<a href="http://code.google.com/apis/accounts/docs/OAuth_ref.html">http://code.google.com/apis/accounts/docs/OAuth_ref.html</a></p>
<p>Gmail IMAP and SMTP using OAuth:<br />
<a href="http://code.google.com/apis/gmail/oauth/protocol.html">http://code.google.com/apis/gmail/oauth/protocol.html</a></p>
<p>Remember to add reference to Maill.dll and appropriate namespaces.</p>
<pre class="brush: csharp;">
// C#

using Lesnikowski.Client.IMAP;
using Lesnikowski.Client.Authentication;
using Lesnikowski.Client.Authentication.Google;

const string consumerKey = &quot;example.com&quot;;
const string consumerSecret = &quot;secret&quot;;
const string email = &quot;pat@example.com&quot;;

Gmail2LeggedOAuth oauth = new Gmail2LeggedOAuth(
    consumerKey, consumerSecret);

using (Imap client = new Imap())
{
    client.ConnectSSL(TestConstants.GmailImapServer);

    string oauthImapKey = oauth.GetXOAuthKeyForImap(email);

    client.LoginOAUTH(oauthImapKey);

    //...

    client.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET

Imports Lesnikowski.Client.IMAP
Imports Lesnikowski.Client.Authentication
Imports Lesnikowski.Client.Authentication.Google

Const  consumerKey As String = &quot;example.com&quot;
Const  consumerSecret As String = &quot;secret&quot;
Const  email As String = &quot;pat@example.com&quot;

Dim oauth As New Gmail2LeggedOAuth(consumerKey, consumerSecret)

Using client As New Imap()
	client.ConnectSSL(TestConstants.GmailImapServer)

	Dim oauthImapKey As String = oauth.GetXOAuthKeyForImap(email)

	client.LoginOAUTH(oauthImapKey)

	'...

	client.Close()
End Using
</pre>
<p>Here are the google apps configuration screens:</p>
<p><a href="http://www.lesnikowski.com/blog/wp-content/uploads/2011/01/2LeggedOAuth1.png"><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/01/2LeggedOAuth1-300x233.png" alt="" title="2LeggedOAuth1" width="300" height="233" class="aligncenter size-medium wp-image-1937" /></a></p>
<p><a href="http://www.lesnikowski.com/blog/wp-content/uploads/2011/01/2LeggedOAuth2.png"><img src="http://www.lesnikowski.com/blog/wp-content/uploads/2011/01/2LeggedOAuth2-300x233.png" alt="" title="2LeggedOAuth2" width="300" height="233" class="aligncenter size-medium wp-image-1938" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/2-legged-oauth-with-gmail/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FTP Active vs Passive</title>
		<link>http://www.lesnikowski.com/blog/ftp-active-vs-passive/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ftp-active-vs-passive</link>
		<comments>http://www.lesnikowski.com/blog/ftp-active-vs-passive/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 10:05:23 +0000</pubDate>
		<dc:creator>Pawel Lesnikowski</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[FTP]]></category>
		<category><![CDATA[Ftp.dll]]></category>
		<category><![CDATA[FTPS]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.lesnikowski.com/blog/?p=2019</guid>
		<description><![CDATA[Ftp.dll .NET FTP component supports both Active and Passive mode FTP transfers. In Active mode client waits for incomming data connections, in Passive mode client establishes data connections. Passive mode is default. You can switch to Active mode using Mode property: // C# using (Ftp client = new Ftp()) { client.Mode = FtpMode.Active; client.Connect(&#34;ftp.example.com&#34;); client.Login(&#34;user&#34;, [...]]]></description>
			<content:encoded><![CDATA[<p>Ftp.dll <a href="http://www.lesnikowski.com/ftp/">.NET FTP component</a> supports both Active and Passive mode FTP transfers.</p>
<p>In <strong>Active</strong> mode client waits for incomming data connections, in <strong>Passive</strong> mode client establishes data connections.</p>
<p>Passive mode is default. You can switch to Active mode using <strong>Mode</strong> property:</p>
<pre class="brush: csharp;">
// C#

using (Ftp client = new Ftp())
{
    client.Mode = FtpMode.Active;

    client.Connect(&quot;ftp.example.com&quot;);
    client.Login(&quot;user&quot;, &quot;password&quot;);

    // ...

    client.Close();
}
</pre>
<pre class="brush: vb;">
' VB.NET

Using client As New Ftp()
    client.Mode = FtpMode.Active

    client.Connect(&quot;ftp.example.com&quot;)
    client.Login(&quot;user&quot;, &quot;password&quot;)

    ' ...

    client.Close()
End Using
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lesnikowski.com/blog/ftp-active-vs-passive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

