Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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();
Add Comment
Please, Sign In to add comment