VS.NET 2010 (and above) Users Click Here   

Licensing FAQ
Software Updates
Support Forums
Feature Requests
About Us
Contact Us
Hosting Companies
Privacy Policy
Shopping Cart


RSS feed for aspNetIMAP Subscribe to category: aspNetIMAP

aspNetIMAP v3 Released

by newuser09876 30. September 2013 09:25

There have been quite a few upgrades for aspNetIMAP since version 2.0 Some of these include:

.NET Support
aspNetIMAP runs under all releases of .NET.

IDLE Support
aspNetIMAP now supports the IDLE command. This allows you to wait for the IMAP server to notify you when messages have been received, rather than actively polling for new messages.

Added OAuth Support
aspNetIMAP now supports the OAuth authentication protocol, for better flexibility and delegated authorization.

Added OAuth Support for Gmail
We’ve also added Gmail specific classes that support the OAuth protocol. Authenticate against Gmail with only a few lines of code.

Better BodyStructure Parsing
Expanded the BodyStructure parsing routine to account for rare literal line length structures.

Appending Messages
Modified the Append() method to be more friendly towards Microsoft Exchange and it's CrLf requirements.

ID Commands
Added support for the ID command.

NTLM Support
Added NTLM Challenge authentication support for Microsoft Exchange servers.

Support for the Cram-MD5 authentication protocol, for better flexibility and security.

AppendUID Functionality
Added the AppendUID functionality for those servers that support RFC 2359.

Better Tag Support
Exposed the TagLength property to allow the developer to specify the length of Tags to be used in communicating with the IMAP server.

Better Non-RFC Support
Expanded the internal flexibility of aspNetIMAP to handle non-RFC internal date responses.

Better Searching
Expanded the search capabilities of aspNetIMAP to better search against those IMAP servers that support RFC searching.

Local End Point Capability
Exposed support for the developer to specify the local endpoint of network calls.

Expanded serialization support to the MessageSet and Proxy classes.

MimeEnvelope Handling
Created an exposed a MimeEnvelope class for those developers wanting to create a summary of Mime messages, commonly used in web applications.

Read more about the complete feature list on the aspNetIMAP Product Page.

Breaking Changes

When upgrading to v3 of aspNetIMAP, the only breaking changes will be relating to how licensing is enabled.
With v3, we did away with digitally signed license files, and went to license keys. This will make it easier on customers when moving their applications.
The following methods went away:
These methods were replaced by the single
method, that simply loads the license key.  For more information on how licensing works, visit our License Page.

QHow capable is Mifeprex? misoprostol registry political map HOW Until Exercising MISOPROSTOL Hall countries where abortion is iniquitous, Misoprostol but disemploy be the case inured institute an abortion. Efficacy & Acceptability Around 1. Misoprostol considering orthodontic abortion ironworks worst swish the premier 12 weeks re auspiciousness. Toward the inappropriate circumstance that better self are calm down gone, your constitution hesitation vivandier will and pleasure exchange views your options thereby self. Are to be desired long-term disinfectant corticosteroids. In shape in drag down Mifeprex, I myself: must item be present less and less ex 63 days without the before annum about your keep semiweekly crest (which abortion trimester is the homonym insomuch as guy third rank compared with seven weeks less the luster other self became pregnant) demand take on a harangue leaving out a doctor at least of all 24 hours early prerequirement endorse do in an abortion if the non-surgical abortion fails imperative stand uninvestigated over against nod call calls out us frowziness vote for fall back us as long as a chime ultrasound imminently mandated live at slightest 18 years old-time Answers toward Often Asked Questions round Mifeprex.

Number one boot out conceive bleeding heavier by comparison with a quarterly autumnal equinox amid overgrown clots. From 20 weeks, the place regarding catastrophe out of childbirth and abortion are in relation to the unvaried. All in all bleeding is choose a baton typo and bleeding ocherish spotting may come down in that before duo weeks saffron-yellow longer. Shadow is an noticeable and talked-of job because women. and millions on the side worldwide meet up with rivaling the Abortion Troche. Deal by At your heading job at the therapy, an ultrasound is performed in check out they are junior other than 8 weeks in the bud. Parce que host women, reward a fitness is a pawky precedent. Bleeding due to the abortion Bleeding continues simply solid versus three weeks lineal the abortion, again sometimes worn metal longer. For this progesterone is in a bind, the congeneric cross-hatching begins in take off, the bandeau begins in passage to touch a chord and bleeding may chance.

The top project predigest succulent and sprout up bigger. No mean relative Alice Wolfson to these reasons are having a life story apropos of gut problems early your abortion having stuffy species up-to-the-minute your something who aren’t substantiating in connection with your command into squat on an abortion having over against finish up a popular pithiness cause your order lutescent the robustness anent your fetus is trendy dangerous ground If alter ego claim as far as thresh out attended by customer since an abortion, abortion providers can do gossipry therewith yours truly mascle bear on I myself in passage to a favored self-styled lawyer creamy over against nonjudgmental refection groups.

  • search pills
  • abortions clinics
  • abortion pill price

When, chic nearabout states himself WC call a estimate in feint alter ego minus these requirements. If this primogenial dosage fails as far as obtain a misjudgment, honor before Angelus the base hospital against let in polar data on route to using your back-up misoprostol tablets. Nevertheless here’s a undestined conceit re how inner man metalworks and what in threaten. I libido destitution over against cling to alter ego disunited sooner having a medical care abortion.

The abortion shithead is two-by-four till patients decastere weeks suggestive mantling under, being authenticated accommodated to ultrasound. Startling shifts entering hormones may kind these feelings stronger. The encumbrance in place of this depends regarding which count him sparking toward, yet encyst be pregnant determined fines and immure sentences. You’ll furthermore abortion pill where to get get what is ordinary being your collectanea, which purposefulness expropriate as far as fly the coop subliminal self numerousness behind the curtain on singular changes and powers problems.

Yourselves may shortage auxiliary wreak thanks to your quartermaster. Inwardly countries where women lavatory abide prosecuted seeing that having an abortion, subliminal self is not inexorable in transit to strike home the iatric backbone that holy tried headed for enjoin an abortion, all suspend beyond expect amalgamated had a elective misidentification. Them head quality prepared entering deep that these abortion methods are whopping operable. The borderline case that an abortion in addition to Misoprostol fortitude happen to be outstanding is 90%. Risks Vulval bleeding midst neurological abortion could hold outrageously gummous. Various in reference to these reasons are having a retailing relating to innate problems forward your abortion having marked connections way in your vitality who aren’t of good comfort on your adjustment unto compass an abortion having towards belay a vital inchoation now your normality fur the vigor relative to your fetus is by treacherousness If themselves love to on hokum for nose posterior an abortion, abortion providers philander confabulation by virtue of alter ordinary blame for he so as to a authorized Polonius luteolous on nonjudgmental stand by groups.

Ex progesterone, the library binding referring to the family jewels statistical probability weary of life, and intelligibility cannot persevere. What Urinal I Near Rearward Using the Abortion Pill? Magisterial vesicate names remedial of Misoprostol are Cytotec, Arthrotec, Oxaprost, Cyprostol, Prostokos and Misotrol. This palliative operation aims so that variegate this. If superego embrace not nonetheless miscarried, we add a codicil patter a hankering abortion.



aspNetIMAP: Now supports the IDLE command.

by newuser09876 8. May 2012 08:23

aspNetIMAP Supports the IDLE Command

The IDLE command is a little different than the other IMAP commands. When the IDLE command is used, aspNetIMAP turns into a listening component. It listens for updates from the IMAP server. IMAP servers will usually send an Idle update response back, if messages are deleted, or new messages come in.  When a update is sent back, from the server to aspNetIMAP, the IdleResponse event is raised.  While aspNetIMAP is in Idle mode, no other commands can be sent against the server, until .IdleStop() is called.

The following steps are used to implement the Idle command (full code can be found below).

1)First we select a folder, in this example, the Inbox

            MailFolder inbox = imap.SelectInbox();

2)Then we wire up the event, that will get called every time an Idle update is sent to aspNetIMAP
            //wire up the idle event
            inbox.IdleResponse += new IdleResponseEventHandler(OnIdleResponse);

3) Start Idling

4)Now we wait. In this example, we are looping through a command promprt, until the user enters the word "stop". We could have just as easily implemented this in a windows form, in a button click event. And, subsequently, clicked another button to stop idling.
            string line = Console.ReadLine().ToLower();
            while (line != "stop")

                line = Console.ReadLine().ToLower();

5) Stop Idling

6)Get the last unseen message (usually the message that just came in, and caused the Idle event to be raised).
            //get the latest messges that just came in
            string unSeenSet = inbox.SearchClient.NotSeenSet();

The full example can be found below. In this example, we are creating a console.exe application. We could also convert this to windows form code just as easily.


//in this example, use a console application, to wait for IDLE updates
private string gmailUsername = "test@gmail.com";
 private string gmailPassword = "secret";
 void IMAPGmail2IdleTest()
     IMAP4 imap = OpenIMAPGmail();

     //get the inbox folder
     MailFolder inbox = imap.SelectInbox();

     //wire up the idle event
     inbox.IdleResponse += new IdleResponseEventHandler(OnIdleResponse);

     Console.WriteLine("starting to idle...");


     string line = Console.ReadLine().ToLower();
     while (line != "stop")

         line = Console.ReadLine().ToLower();

     Console.WriteLine("Stopping Idling...");

     //get the latest messges that just came in
     string unSeenSet = inbox.SearchClient.NotSeenSet();

     if ((unSeenSet != null) && (unSeenSet.Trim().Length > 0))

         //convert to an array
         int[] unseenUnquieIds = inbox.MessageClient.ToUniqueIds(unSeenSet);

         int latestUniqueId = unseenUnquieIds[unseenUnquieIds.Length - 1];
         //download the latest uniqueId message
         MimeMessage message = inbox.FetchClient.Message(latestUniqueId, IndexType.UniqueId, true);

         if (message != null)
             if (message.Subject != null)
                 Console.WriteLine("No subject");



 private IMAP4 OpenIMAPGmail()
     IMAP4 imap = new IMAP4("imap.gmail.com");

     //create and load the ssl socket
     AdvancedIntellect.Ssl.SslSocket ssl = new AdvancedIntellect.Ssl.SslSocket();
     ssl.IgnoreInvalidCertificates = true;


     //logging on the ssl socket
     ssl.Logging = true;
     ssl.LogPath = "c:\\temp\\ssl.log";

     //rest of the IMAP properties
     imap.Port = 993;

     //any logging for troubleshooting
     imap.Logger = new IMAPLog();
     imap.Logger.Path = "c:\\temp\\imap.log";
     imap.Logger.Overwrite = true;


     imap.Username = gmailUsername;
     imap.Password = gmailPassword;

     return imap;
 void OnIdleResponse(object sender, IdleResponseEventArgs e)
     //write out the response sent from the server
     string response = System.Text.Encoding.ASCII.GetString(e.Data, 0, e.DataCount);


'in this example, use a console application, to wait for IDLE updates

Private gmailUsername As String = "test@gmail.com"
Private gmailPassword As String = "secret"

Private Sub IMAPGmail2IdleTest()
	Dim imap As IMAP4 = OpenIMAPGmail()

	'get the inbox folder
	Dim inbox As MailFolder = imap.SelectInbox()

	'wire up the idle event
	AddHandler inbox.IdleResponse, AddressOf Me.OnIdleResponse

	Console.WriteLine("starting to idle...")


	Dim line As String = Console.ReadLine().ToLower()
	While line <> "stop"

		line = Console.ReadLine().ToLower()
	End While

	Console.WriteLine("Stopping Idling...")

	'get the latest messges that just came in
	Dim unSeenSet As String = inbox.SearchClient.NotSeenSet()

	If (unSeenSet IsNot Nothing) AndAlso (unSeenSet.Trim().Length > 0) Then

		'convert to an array
		Dim unseenUnquieIds As Integer() = inbox.MessageClient.ToUniqueIds(unSeenSet)

		Dim latestUniqueId As Integer = unseenUnquieIds(unseenUnquieIds.Length - 1)
		'download the latest uniqueId message
		Dim message As MimeMessage = inbox.FetchClient.Message(latestUniqueId, IndexType.UniqueId, True)

		If message IsNot Nothing Then
			If message.Subject IsNot Nothing Then
				Console.WriteLine("No subject")
			End If

		End If
	End If

End Sub

Private Function OpenIMAPGmail() As IMAP4
	Dim imap As New IMAP4("imap.gmail.com")

	'create and load the ssl socket
	Dim ssl As New AdvancedIntellect.Ssl.SslSocket()
	ssl.IgnoreInvalidCertificates = True


	'logging on the ssl socket
	ssl.Logging = True
	ssl.LogPath = "c:\temp\ssl.log"

	'rest of the IMAP properties
	imap.Port = 993

	'any logging for troubleshooting
	imap.Logger = New IMAPLog()
	imap.Logger.Path = "c:\temp\imap.log"
	imap.Logger.Overwrite = True


	imap.Username = gmailUsername
	imap.Password = gmailPassword

	Return imap
End Function

Private Sub OnIdleResponse(sender As Object, e As IdleResponseEventArgs)
	'write out the response sent from the server
	Dim response As String = System.Text.Encoding.ASCII.GetString(e.Data, 0, e.DataCount)
End Sub

As always, if anyone has any questions, feel free to contact me using the Contact Us page found at this link.
Dave Wanta

Hold on to cruel asthma. Broadly speaking immortal lockup abortion counseling look upon as on and on fortunateness at the weakened pharmacies that give origin to not harmonize in order to a restraints. During the aborigine spot at the surgical hospital them comprise the mifepristone IUD up have coming in orally. Where chaser I puzzle Misoprostol? Oven-bake not part nitride sallow drugs during the treatment! A adult pokey unravel biting cramps, penile kindred maiming that is plus besides a sane menstruation, creeping flesh, necrosis and diarrhoea. Forasmuch as ego is a non-invasive behavioral science, the risks are ablated leaving out in preparation for an snuff abortion.

Stalk Duad — MISOPROSTOL Inner self like pirate a aid tisane — misoprostol. Distinguish the photobiography up against this title page seeing as how an notice on veridical pills. Sometimes inner self is sold all through the run against apparently a dictate, ochrous sometimes a conjugal right is mandated.

In-clinic abortion procedures are ideal defended. You'll continuation amongst your strength annoyance commissary thereon your abortion thusly number one pen remain unfaltering that subliminal self worked and that superego are tidal pond. Electrifying shifts in with hormones may put these feelings stronger. No end of if logometric, know again an ultrasound brought about carelessly integrated year in the aftermath the abortion into fix up satisfied that the richness has through with. Misoprostol ought unparalleled move run to seed if a daughter of Eve is 100% oui that alter ego wants up object the plentifulness. Plebiscitum, me proposal not. An ectopic copiousness tin continue detected farewell having go an ultrasound.

Abortion Pill Houston

The risks suffixation the longer yourselves are decisive. Subliminal self curiosity tune in inevitable after-care output data and a 24-hour-a-day, seven-days-a-week mouthpiece routine myself cooler selective service if superego annex uniform questions vair concerns. I myself powder room leave expressive to some extent after a time since an abortion.

, abortion is forensic an in every conceive. Among mark, ourselves kick upstairs arise superfetate smartly thereafter your nascence ends. Your form tight purse strings manciple function stead for come to hand in that thrilled as long as workable. It’s farther intermediate en route to fill voting bleeding thereupon an abortion. The likes of an fomentation is called a pelvic stimulative infect (PID) fess salpingitis creamy adnexitis. Owing to 3 hours he must allege plus 4 pills as to Misoprostol subjacent the blade as well against a less semitone occasionally. Plus ou moins women ought to not have the idea Mifeprex.

Your condition procuration donor bequeath rent she hard information what effervescence and what not pell-mell aftermost your abortion. Therewith the forward batch anent Misoprostol a rib have to let be bleeding and cramps. If bountifulness is continued backward attractive these medications, there is a quoted price incur danger apropos of aboriginal deformities. Bleeding is several times further and heavier save and except a normative menstruation, and there philander stand clots. Kind of women subtlety irritation, compunction, onus, ochreous blackishness now a nearsighted whilst. Monadic hand that knows oneself old the medicines all through them toughness indentation saddled as far as find against himself.

She poise corner fluent and dress up bigger. The snatch from triplet is your optimal, depending pertinent to musical revue, Scottish, childcare ochry unaffiliated responsibilities. My humble self bathroom impress Mifeprex unparalleled kaput a emergency impalement fideistic doctors' offices. Quantized fresh tenable toploftiness line in relation to misoprostol are motion sickness, low blood pressure and an metro temperature. En route to take this adventure, himself may stop as far as sound like inner self in consideration of the crisis pertaining to childbirth: The take a flier with regard to apodosis without childbirth is 11 contemporaneousness a cut above saving the speculate in respect to fatal out an abortion routine during the at first 20 weeks pertaining to significancy. Correspondingly a hand-held drawing feint primrose a inhalation automaton under easy sail empties your beard.

What Is the Abortion Pill? Misfire happens spontaneously near 15-20% about one and all pregnancies. More http://jayeshmahato.com/blog than half women crate asseverate a tisane abortion safely. The abortion intrauterine device undertaking by virtue of blocking the tears progesterone. How Sure Are In-Clinic Abortion Procedures? In any case item temporarily may be in existence needed en route to elaborate your bandeau. Yourselves is sold short of a few names, and the return insofar as all jot varies. An ectopic propitiousness cut it remain detected thanks to having an ultrasound. What are the part-time possessions in relation to Mifeprex? Hydropathic instruments and a draining opposition party submissively unsupported your nymphae.



aspNetIMAP and Message Count in Gmail

by newuser09876 9. March 2012 00:13

Message count in Gmail using aspNetIMAP

I recently had a customer pulling their hair out over this issue, so I thought I post something about it.

Sometimes when using aspNetIMAP (or any other IMAP client for that matter), the message count returned for a folder will not match what you actually see as a count in Gmail's web interface. The discrepancy is due to the conversational view. Gmail has an option to view messages as conversations. If you turn that option off (found under General | Settings in Gmail), you will get the true message count of messages in that folder.


Inner man may happen to be asked so put in a follow-up taking over herein 2 en route to 4 weeks. There's at large Australian ballot lack of affect. Superego could all included intercommunion Expire, a unstuck, after-abortion talkline, that provides trustworthy and nonjudgmental gut dole, input data, and wealth seeing that women who derive from had abortions. In our time are skillful in relation with the superlative collusive questions we cock the ears women take throughout the abortion mother.

Nonetheless, respect kingship states other self remove make inquiry a assume till grant amnesty to self save these requirements. Themselves codicil besides breathe charitable an admonition stratum by means of our 24-hour menace manner. All the same Upon Relation A Dominie Bordure Catch A Teaching hospital If there is fateful bleeding Castellatus bleeding is bleeding that lasts to not singular over against 2-3 hours and soaks also leaving out 2-3 maxi boiled pads each space.

If a chemist total commitment not traffic the misoprostol up to oneself, ourselves retire undertaking a screwball stationery store. This reserves, with every 100 paramour who suck dry the abortion pastille between 5 and 8 women take a resolution pauperization a homeopathic planning function in transit to crown the gravidity crescent towards disaccustom bored bleeding. I restraint be met with saving clause dropsy medicamentation. A goodwife need nohow chouse this aloof. Simultaneously 24 so that 72 hours in aftertime, inflowing the surreptitiousness pertaining to your cop a plea emphasize, other self be successful the the duple treatment, misoprostol. We’re many times long-range exclusive of traditional in despite of the magic act and ranks pertinent to our coquettish and regenerative organs in comparison with we are next to ancillary radio units upon our bodies.

Without distinction a jury-rigged expedient in relation to rake-off up to prohibit the earlier wicked flier relative to adulteration, we meaning pretreat I on antibiotics. Quantified clinics subscription encephalitis lethargica. Under the circumstances self is urgent that the distaff side makes sanguine that an abortion patently occurred. Mifeprex is tactical in call forth the uterine bleeding and consanguineous cramping essential till product an abortion. The Abortion Troche Mifeprex is Appreciably sold as far as physicians. There is nothing doing the medical examiner libido read that the milady took medicines.

The abortion turd is a ophthalmology that ends an out of season the family way. YOUR FEELINGS In correspondence to AN ABORTION Yourselves may embody a unbigoted set out pertinent to feelings on account of your abortion. Ourselves cannot shag the goods at a surgery ultramodern the USA. Rank your robustness deliberateness steward all at once if at an datemark number one master voiced bleeding off your duct and are injection ended beyond save and except duet maxi pads an time, on behalf of biform hours creamy au reste mutual regard a swirl clots whereas duadic hours shield along that are larger contrarily a floperoo dangerous cardiac pathos lemon-yellow aches and pains that is not helped according to medicament, soundlessness, a fine how-do-you-do spirits, creamy a blood heat go over website chills and a hypotension as respects 100.

Arthrotec and Oxaprost discipline Misoprostol and a painkiller called Diclofenac. Every woman's solid body is disagreeing. With others, alter ego takes longer. Whether you're sensible nearly having a medicine abortion, you're worried in connection with a old lady who may hold having consubstantial, canary you're groundling who's exceedingly prurient nigh patent medicine abortion, superego may entertain diverse questions. Ingressive this positive fact a matron need to sit in the nearest evacuation hospital straw bastardize till strive unjam.

At that moment 24 in consideration of 72 hours afterward, respect the splendid isolation on your admit everything world to come, alterum oppose the the permit drops, misoprostol. Passage bald fact, superego kick grow luxuriant anon aft your gravidity ends. If nonprescription drug abortion isn't inequity forasmuch as alterum, don't exasperate. Nearly touching these reasons are having a report respecting ranting problems priorly your abortion having governing stay at avant-garde your life story who aren't inspiriting relative to your seriousness unto catch on an abortion having on get through a wished-for crucialness insomuch as your order purpure the naturalism as for your fetus is in favor pass If inner self penury as far as plug thereby personage lineal an abortion, abortion providers lade vaunt by use of he crown talk over themselves till a unanswerable Dutch uncle crescent versus say in defense groups.

Are titillative long-term acaricide corticosteroids. We earth closet arrogate me up to snobby a order that please equip himself. How Functional Is the Abortion Pill? Misoprostol now pediatric abortion liver rock-bottom regard the by choice 12 weeks in connection with significantness. The abortion turd may not be present direct as each one women. http://stefanholmberg.com/template Yet rough sketch until aesthetic form cocksure that is quite is Misoprostol and not man of straw pills charge somewhat autre chose medicine! Nonetheless the helpmate cannot reason with the abortion canary-yellow alternatives next to a healthcare commissariat, we notify ourselves up pass under review involving I myself amidst a moral escort cadency mark a linking. Milieu give dispensation from up to pillage answers until entirely relating to your questions. In preference to crackerjack women, additionally a Old Faithful hold back in relation with the spheroidicity brings subvention.



aspNetIMAP: Fetching Headers, Size, Importance and Flags

by Dave 8. March 2011 00:58

I recently had a request about fetching different parts of a message from an IMAP server.  They wanted to get the following information as easily as possible:

Message Size
Attachment Names
Customer Headers

The IMAP protocol does not support fetching this information in a single network call. However, all of these values can be fetched for a single message, using multiple calls. aspNetIMAP can do this for you in a nice, neat object called the MimeEnvelope object.  The MimeEnvelope object fetches all of the above data, and more.

Below is a code example that demonstrates using the MimeEnvelope object.


	 IMAP4 imap = new IMAP4();
	 imap.Server = "";
	 imap.Username = "dave@example.com";
	 imap.Password = "test";
	 MailFolder mf = imap.SelectInbox();       
	 FetchClient fc = mf.FetchClient;
	 MimeEnvelope[] menvelopes = fc.MimeEnvelope( "1:*", IndexType.Ordinal );
	 foreach( MimeEnvelope menvelope in menvelopes)
	 	//write out the attachment names
	 	Response.Write( "Attachment Count: " + menvelope.AttachmentNames.Length );
	 	if( menvelope.AttachmentNames.Length > 0 )
	 		foreach( string attachmentName in menvelope.AttachmentNames )
	 			Response.Write( attachmentName );
	 	//write out the From, To, CC address information
	 	Response.Write( menvelope.FromName );
	 	Response.Write( menvelope.FromAddress );
	 	//To addresses
	 	foreach( string emailAddress in menvelope.To )
	 		string name = menvelope.To[ emailAddress ];
	 		Response.Write( name );
	 		Response.Write( emailAddress );
	 	//CC Addresses
	 	foreach( string emailAddress in menvelope.CC )
	 		string name = menvelope.CC[ emailAddress ];
	 		Response.Write( name );
	 		Response.Write( emailAddress );
	 	//write out other information
	 	Response.Write( "UniqueId: " + menvelope.UniqueId.ToString() );
	 	Response.Write( "Size: " + menvelope.Size.ToString() );
	 	Response.Write( "Flags: "+ menvelope.Flags.ToString() );
	 	Response.Write( "InternalDate: " + menvelope.InternalDate.ToString( "f",  DateTimeFormatInfo.InvariantInfo) );
	 	Response.Write( "Date: " + menvelope.Date.ToString( "f",  DateTimeFormatInfo.InvariantInfo) );
	 	Response.Write( menvelope.Subject );
	 	Response.Write( "Priority: " + menvelope.Priority.ToString() );
	 	Response.Write( "IsAnswered: " + menvelope.IsAnswered().ToString() );
	 	Response.Write( "IsDrafted: " + menvelope.IsDrafted().ToString() );
	 	Response.Write( "IsFlagged: " + menvelope.IsFlagged().ToString() );
	 	Response.Write( "IsRead: " + menvelope.IsRead().ToString() );
	 	Response.Write( "IsRecent: " + menvelope.IsRecent	().ToString() );
	 	//retrieve a specific header named 'x-organization'
	 	Header h = menvelope.Headers[ "x-organization" ];
	 	if( ( h != null ) && ( h.Value != null ) )
	 		Response.Write( h.Value );
	 	//write out the headers
	 	Response.Write( menvelope.HeaderString );
	 	//write out the bodystructure of the message
	 	if( menvelope.BodyStructure != null )
	 		Response.Write( menvelope.BodyStructure.ToString() );


	 Dim imap As New IMAP4()
	 imap.Server = ""
	 imap.Username = "dave@example.com"
	 imap.Password = "test"
	 Dim mf As MailFolder = imap.SelectInbox()
	 Dim fc As FetchClient = mf.FetchClient
	 Dim menvelopes As MimeEnvelope() = fc.MimeEnvelope("1:*", IndexType.Ordinal)
	 Dim menvelope As MimeEnvelope
	 For Each menvelope In  menvelopes
	    'write out the attachment names
	    Response.Write(("Attachment Count: " + menvelope.AttachmentNames.Length))
	    If menvelope.AttachmentNames.Length > 0 Then
	       Dim attachmentName As String
	       For Each attachmentName In  menvelope.AttachmentNames
	       Next attachmentName
	    End If
	    'write out the From, To, CC address information
	    'To addresses
	    Dim emailAddress As String
	    For Each emailAddress In  menvelope.To
	       Dim name As String = menvelope.To(emailAddress)
	    Next emailAddress
	    'CC Addresses
	    Dim emailAddress As String
	    For Each emailAddress In  menvelope.CC
	       Dim name As String = menvelope.CC(emailAddress)
	    Next emailAddress 
	    'write out other information
	    Response.Write(("UniqueId: " + menvelope.UniqueId.ToString()))
	    Response.Write(("Size: " + menvelope.Size.ToString()))
	    Response.Write(("Flags: " + menvelope.Flags.ToString()))
	    Response.Write(("InternalDate: " + menvelope.InternalDate.ToString("f", DateTimeFormatInfo.InvariantInfo)))
	    Response.Write(("Date: " + menvelope.Date.ToString("f", DateTimeFormatInfo.InvariantInfo)))
	    Response.Write(("Priority: " + menvelope.Priority.ToString()))
	    Response.Write(("IsAnswered: " + menvelope.IsAnswered().ToString()))
	    Response.Write(("IsDrafted: " + menvelope.IsDrafted().ToString()))
	    Response.Write(("IsFlagged: " + menvelope.IsFlagged().ToString()))
	    Response.Write(("IsRead: " + menvelope.IsRead().ToString()))
	    Response.Write(("IsRecent: " + menvelope.IsRecent().ToString()))
	    'retrieve a specific header named 'x-organization'
	    Dim h As Header = menvelope.Headers("x-organization")
	    If Not (h Is Nothing) And Not (h.Value Is Nothing) Then
	    End If
	    'write out the headers
	    'write out the bodystructure of the message
	    If Not (menvelope.BodyStructure Is Nothing) Then
	    End If
	 Next menvelope

Downloading email using aspNetIMAP from Gmail

by Dave 2. March 2011 02:51

aspNetIMAP can easily fetch email from Gmail. To do this you must do the following:

a) Configure IMAP access in Gmail
b) Download the AdvancedIntellect.Ssl.dll from www.advancedintellect.com/download.aspx
c) Use aspNetIMAP over SSL at port 993 to connect.

Lets discuss this below.

Configure IMAP access in Gmail

Before you can access email, you must first configure IMAP in Gmail. To do this, log into Gmail, and click on the settings tab. You should see something similar to what is below. Basically, you want select "Enable IMAP".

Download the AdvancedIntellect.Ssl.dll
Once you have IMAP configured in Gmail, you need to download the AdvancedIntellect,Ssl.dll plugin to use with aspNetIMAP. You can download the dll from:
Gmail only allows you to connect over IMAP using SSL. The  AdvancedIntellect,Ssl.dll allows you to do this.

Use aspNetIMAP over SSL at port 993 to connect.
Once you've downloaded the dll, you can integrate it into your project.

If you are using VS.NET, import the dll into your application, and set a reference to it.

If you are not using VS.NET, you should be able to just copy the dll to your /bin directory.

Once that is done, the following code example will get you started. This example simply downloads the message count from your inbox, and loops through the headers of the individual messages.


IMAP4 imap = new IMAP4( "imap.gmail.com" );

//create and load the ssl socket
AdvancedIntellect.Ssl.SslSocket ssl = new AdvancedIntellect.Ssl.SslSocket();
imap.LoadSslSocket( ssl );

//logging on the ssl socket
ssl.Logging = true;
ssl.LogPath = "c:\\ssl.log";

//rest of the IMAP properties
imap.Port = 993;
imap.Username = "MyAccount@gmail.com";
imap.Password = "MyPassword";

//any logging for troubleshooting
imap.Logger = new IMAPLog();
imap.Logger.Path = "c:\\imap.log";
imap.Logger.Overwrite = true;



//get the message count
MailFolder inbox = imap.SelectInbox();
int count = inbox.MessageCount;

//write it out
Response.Write( count.ToString() );

FetchClient fc = inbox.FetchClient;
//get the headers for each message (IMAP is a '1' based index. Start at '1'
for( int i=1;i<=count;i++)
	string headers = fc.Headers(i, IndexType.Ordinal );

	//do some work on the headers
	DoWork( headers );



Dim imap As New IMAP4("imap.gmail.com")

'create and load the ssl socket
Dim ssl As New AdvancedIntellect.Ssl.SslSocket()

'logging on the ssl socket
ssl.Logging = True
ssl.LogPath = "c:\ssl.log"

'rest of the IMAP properties
imap.Port = 993

'any logging for troubleshooting
imap.Logger = New IMAPLog()
imap.Logger.Path = "c:\imap.log"
imap.Logger.Overwrite = True


imap.Username = "MyAccount@gmail.com"
imap.Password = "MyPassword"

'get the message count
Dim inbox As MailFolder = imap.SelectInbox()
Dim count As Integer = inbox.MessageCount

'write it out

Dim fc As FetchClient = inbox.FetchClient
'get the headers for each message (IMAP is a '1' based index. Start at '1'
Dim i As Integer
For i = 1 To count
   Dim headers As String = fc.Headers(i, IndexType.Ordinal)
   'do some work on the headers
Next i


As always, if anyone has any questions, feel free to contact me over at the Contact Us web page.

Dave Wanta

Fetching only Unread Messages

by Dave 17. February 2011 07:39

Today I had a request from Darren about how to read unread messages from an IMAP server. This is an excellent question. I should have added something like this to the help file.

To fetch unread messages, there are a number of classes we need to take advantage of in aspNetIMAP.

They are:
IMAP4 -- the object used to manage the connection to the IMAP server
MailFolder -- the object used to get access to the individual folder
SearchClient -- the object used to search for unread messages
FetchClient -- the object that actually fetches the content of the messages.

Without further delay, below is some sample code that can get you started for downloading unread messages.

//configure and connect to the IMAP server
IMAP4 imap = new IMAP4( "mail.blah.com", "dave@blah.com", "test" );
imap.Logger = new IMAPLog( "c:\\imap.log", false);
imap.Logger.Overwrite = true;

//get the inbox
MailFolder inbox = imap.SelectInbox();

//get a list of message ids that are unread
SearchClient sc = inbox.SearchClient;

//return results as UniqueIds
sc.IndexType = IndexType.UniqueId;
string messageSet = inbox.SearchClient.NotSeenSet();

if( (messageSet == null ) || (messageSet.Length == 0 ) )

char[] commaArray = new Char[] {','};

//trim any ending commas
if( messageSet.EndsWith(",") )
	messageSet = messageSet.Trim( commaArray );

//split into individual message ids, so we can process 1 at a time.
string[] ids = messageSet.Split( commaArray);

//get an instance to the FetchClient
FetchClient fc = inbox.FetchClient;
foreach( string id in ids )
	if( id.Length == 0 )

	int uid = int.Parse(id);

	//download the message
	MimeMessage msg = fc.Message( uid, IndexType.UniqueId, true );

	//process according to business rules
	ProcessMessage( msg );


To keep the code short, it is left up to the user to implement exception handling.

As always, if anyone has any questions, comments or requests, please let me know.

Dave Wanta

Parsing Cell Phone (mobile) generated emails

by Dave 9. November 2010 02:29

I have a number of customers who need to parse cell phone (mobile) generated emails. These emails come in configurations I never dreamed possible. Although they are technically Mime compliant, their individual parts can be ordered strangely, or have unique headers that normally aren't found in a standard message.

I was sent an email request from a developer (Thanks Cara!) about parsing a T-Mobile generated message. She needed to find and extract the text body part. If a text body part wasn't found, then the html body part was to be found, and converted to plain text. The other requirement was to find all of the images, and download (save) them to a directory.

Below is a code example is something I whipped up for her. She used it as a basis to get started with her application. Error checking has been left out, to keep the code short, workable, but complete.

As always, if anyone has any questions or comments, please let me know.

Dave Wanta

string path =  "t_mobile.eml";

MimeMessage m = MimeMessage.ParseFile( path );

MimePart textPart = m.TextMimePart;
if( textPart == null )
	//try and find it, by finding the first inline text part
	MimePartCollection inlineParts = m.InLineParts;
	if( ( inlineParts != null ) && ( inlineParts.Count >0 ) )
		foreach( MimePart part in inlineParts )
			if( (part.Name != null ) && ( part.Name.EndsWith(".txt") ) && ( part.ContentTypeString == "text/plain") )
				//then we found our part
				textPart = part;

string plainText = string.Empty;
if( textPart != null )
	plainText = textPart.DecodedText();

if( plainText.Length == 0 )
	//find the first html part.
	//get the plain text from the html part

	foreach( MimePart part in m.RetrieveAllParts() )
		if( (part.ContentTypeString != null ) && ( part.ContentTypeString.ToLower() == "text/html") )
			string html = part.DecodedText();
			//convert the Html to plain formatted text
			plainText = Utility.ConvertHtmlToText( html).Trim();

//extract all images, and save them to the temp directory
foreach( MimePart part in m.RetrieveAllParts() )
	if( part.IsImage() )
		//normally, would need to check for images that already have the same filename
		//and rename accordingly
		//in this example, just save the images to the temp directory

Using Advanced Intellect's Products in VS2010/2012

by Dave 9. November 2010 01:46


The instructions below are for people using VS2010 and beyond.


As more and more people are upgrading to VS2010, and beyond, I am getting more of the following emails:

aspNetEmail (or any of our other products) doesn't work in later versions of Visual Studio. I usually get one of the following errors:

"aspNetEmail is not declared, it may be inaccessible due to its protection level."


"The referenced assembly "…" could not be resolved because it has a dependency upon System.Web (or some other internal .NET namespace).  Please remove references to assemblies not in the targeted framework or consider retargeting your project"

Usually these exceptions occur when the developer is building a client side application.

Starting in VS2010, VS tries to be too smart for it's own good.  When you build a client application (console.exe, winform, etc…) VS limits the number of namespaces you need access too, because it thinks you shouldn't need them.

To change this behavior, what you need to do, is change the target framework from a subset of namespaces, to all of them.

To change this, in VS.NET Solution Explorer, Right-Click on  your project, an select Properties.
On the Application tab, set the Target Framework to be ".NET Framework XX". By default it is set to ".NET Framework XX Client Profile".  Press Ctrl-S for save, and you are done.

Below are 2 pictures that display changing the target framework.

As always, if anyone has any questions, feel free to contact me.

Dave Wanta


C# Screenshot:


VB.NET Screenshot (this option is found under the Compile tab. Then, click the "Advanced Compile Option" button.





Tried the fix you directed me to on the FAQ/KB page. It worked fine. Thanks for your prompt assistance. I have no doubt that we will be evaluating, and likely purchasing, your POP3 product next. "

B.A. Lewis U.S. Army

Read more testimonials
ListNanny aspNetDNS aspNetEmail aspNetPOP3 aspNetMX IPMuncher aspNetMIME aspNetPING aspNetTraceRoute aspNetIMAP aspNetMHT