Home   Buy Now   Products   Downloads   Support   Resellers   Jobs   Contact   Site Map   Search
Home   Buy Now   Download   Support  
Email Component, SMTP Component, POP3 Component, IMAP Component, bulk mail

Home
Purchase
Upgrade
 
Products
Downloads
 
Support
 Samples
 KB
 Forum
 
Newsletter
 
Customers
 Current List
 Comments
 
Resellers
Jobs
Contact Us
EasyMail.Net Verify Sample Code

Sample Code

Check out the sample code below to see just how easy it is to use the IMAP4 component of EasyMail .Net Edition.  But don't let the ease of use fool you; the IMAP4component is very powerful and packed with features.  The sample code on this page demonstrates the most basic features of  the IMAP4 component.  Be sure to click on the "Other Samples" tab to find more advanced samples.

C#   VB.Net   Delphi   Other Samples    
Sample Notes
This sample uses the IMAP4 component to log into a mailbox and display the subject of each message. The subject is obtained from the IMAP envelope of the message, so no parsing is required to get this information. IMAP envelopes also contain other 'header' information such as the mesasge sender, recipients, date, etc...

//create a new IMAP4 object, connect 
//to a IMAP4 server and login 
IMAP4 imap = new IMAP4();
imap.Connect("mail.yourdomain.com");
imap.Login("mailbox", "password");
 
//select the inbox and download the envelopes
imap.SelectMailbox("Inbox");
EnvelopeCollection imapEnvelopes;
imapEnvelopes = imap.GetEnvelopes();
 
//loop through each message
//and output the subject
foreach (Envelope imapEnvelope in imapEnvelopes)
{
   //write the subject out to the console
   Console.WriteLine(imapEnvelope.Subject);
}
 
//close resources
imap.Logout();

Copy and paste this code to get a jump start!

 



 

 Product Home
 Features
 What's New in 3.0
 Features Added in 2.x
 System.Web.Mail Comparison
 SMTP Component
 POP3 Component
 IMAP4 Component
 Detailed Features
 Sample Code
 Parse Component
 SSL Plug-in
 S/MIME Plug-in
 Documentation
 Pricing / Licensing

©2012Quiksoft Corporation. All rights reserved. Terms of Use, Privacy Statement, Trademarks